Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: mstinnett on July 01, 2008, 07:16:33 AM

Title: output question
Post by: mstinnett on July 01, 2008, 07:16:33 AM
Can anyone help me with an output signal question?  How do I configure an output signal that is pulled high or low when the Mach 3 has completed its program.  In other words, it signals a PLC that it has completed its work.  Thanks.

Matt
Title: Re: output question
Post by: Hood on July 01, 2008, 08:24:43 AM
You could write a macro and have that at the end of your code, eg write a macro and call it M222.m1s and place it in the macro folder for the profile you are using. Then if you put M222 in your code it will do that output.
The line in the macro to set a modbus output would be as simple as
Call SetModOutput (1,1) where the first 1 is the modbus output and the second is to make it active.
Hood
Title: Re: output question
Post by: poppabear on July 01, 2008, 11:16:20 AM
If your writing to a PLC, as Hood said below, you will also have to put some kind of Macro to turn that signal off, other wize it will stay up, unless told other wise. You can put another macro to turn it off at the beginning of your part run

you could also use brians on your modbus as well
Title: Re: output question
Post by: jimpinder on July 01, 2008, 11:23:21 AM
To follow on from Hood - I would say yes -

write the Macro - if you name it M300 - so it is easy to remember (as opposed to M30) and then make the first line of the script set your output pin, and make the second line call M30.
Title: Re: output question
Post by: Hood on July 01, 2008, 01:08:45 PM
Depends what the output is doing in the PLC, if it just needs to be active for say 1 second then I think you could put this in your macro.


Call SetModOutput (1,1)
Code "G4P1"
Call SetModOutput (1,0)
Title: Re: output question
Post by: Hood on July 01, 2008, 04:13:34 PM
Scott has pointed out that there should be a
While IsMoving ()
Wend


after the
Code "G4P1"

That is why it takes me so long to do VB, I do it so infrequently that i forget how I did it the last time :D
Hood