Gerry:
SetOEMLED(13,1) is not something you can do in Mach3, there is no SetOEMLED call. BUT!!!! There is a "GetOEMLED(xxx)" to look at is status.
The OEM Leds are "Read Only", you cant set them (unfortunatly). They only report the status of the function they represent. DoOEMButton(113) will for instance toggle the state of Flood Coolant, or Code("M8") will turn it on, Code("M9") off.
Dom:
If you want in a Button you could also do this You would need to put your button, and a user LED on the screen that you want to represent the status of OUTPUT1, lets call it 1500. I am assuming OUTPUT1 when active captures/grabs the draw bar. Tick the Use VB radio button and put the below code in the box. in Screen3, in Screen4 you have to goto operator->edit button script, and your button will blink. click it, and a VB window will appear.
put the code below in it, hit ONLY the Save button it will title "Hidden Script".
hit the ok to close the window. Then YOU MUST goto View->Save Current Layout (click the save current layout). Then Go Back and look at Operator->Edit button script to MAKE SURE it DID save it, sometimes it does NOT!!! if you see your script there your good, if not redo the steps again, and recheck.
if GetUserLED(1500) then 'if it is on (Output1 is active)
if GetOEMLED(11) then ' if the spindle is running dont release (safety)
Message("Spindle Must Be OFF to release Tool!!")
' Code("M5") 'Optional spindle stop here
else
DeActivateSignal(OUTPUT1) 'Draw bar Release tool output1 off
SetUserLED(1500,0) 'Turn off your indicator LED
end if
else
ActivateSignal(OUTPUT1) 'Draw bar capture tool output1 on
SetUserLED(1500,1) 'Led is on to indicate capture
end if
'NOTE: if you need the reverse of the above logic just flip everything around.
'Enjoy scott
Commercial Mach3: Screens, Wizards, Plugins, Brains,PLCs, Macros, ATC's, machine design/build, retrofit, EMC2, Prototyping. http://sites.google.com/site/volunteerfablab/