Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: comet on February 08, 2010, 10:09:36 AM

Title: operating relays
Post by: comet on February 08, 2010, 10:09:36 AM
Hi,
 I need to operate some relays to opreate work clamps etc.
I know I can use spare coolant g code, but how do you do it without
using g04 Is there spare g or m numbers that can be used?
   Tony
Title: Re: operating relays
Post by: Hood on February 08, 2010, 11:27:09 AM
You can make up custom macros and have the dwell in the macro itself then you would just call the macro with the M code you called it, for example if you called the macro m123.m1s, you would call m123.

Hood
Title: Re: operating relays
Post by: comet on February 08, 2010, 12:21:55 PM
Thanks, but that leads to the question,how do you do macro's?
Title: Re: operating relays
Post by: Hood on February 08, 2010, 06:33:59 PM
Well you could have something like

Activate Signal (OutPut3)
Sleep (2000)

What that would do is switch on output 3 then wait for 2 seconds then Mach would again carry on.
To switch the output off you would write another macro and have

DeActivateSignal(OutPut3)
Sleeep(2000)


Hood