Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Cncman2nv on March 04, 2014, 11:22:39 PM

Title: Adding UserLED to Change State from M10/M11
Post by: Cncman2nv on March 04, 2014, 11:22:39 PM
Hello,
I am having trouble getting a LED that I have Added to the MSM User Extense Page. What I am trying to accomplish is for the M10/M11 Call  will change the state of the LED
M10 LED ON M11 LED OFF so that I can Make a Brain to communicate with a plc that will operate a pneumatic solenoid.
Steps I have Taken

Created a UserLed (2000) added to MSM User Exts Page

Modified the   M10.m1s

Dim FrontCloser As Integer
FrontCloser=(2000)
 
 SetUserLED(Frontcloser,1)

Modified the   M11.m1s

Dim FrontCloser As Integer
FrontCloser=(2000)
 
 SetUserLED(Frontcloser,0)
 
Thank You for your valuable help.
Title: Re: Adding UserLED to Change State from M10/M11
Post by: Tweakie.CNC on March 05, 2014, 04:09:00 AM
Hi Adam,

I am not absolutely certain because Mach3 is always full of surprises but I don't think you will be able to use the M11/M10 in that way because they have been more or less designated for laser control.

If you use the command M11P1 this will switch ON Output#1 and the command M10P1 will switch OFF Output#1 but both these commands only take effect at the instant of an axis (any axis) movement (ie. they must be followed by an axis movement on the next line in the GCode. The numeral following the P will determine which Output# is switched).

Hope this helps.

Tweakie.