901
Mach4 General Discussion / Having trouble with Lua Script
« on: April 21, 2015, 05:46:06 PM »
I am having trouble finding examples and syntax for LUA that goes with Mach 4. Initially I need to know how to turn on outputs via macros.
here is an example from VB Script. Can anyone help me translate this to LUA and if they have time explain it a little bit?
Thanks!!
-Chad
REM M1000 Clamp
DeActivateSignal (output4) 'Turns off the solenoid that unclamps.
ActivateSignal (output3) 'Turns on the solenoid that clamps.
REM Waits for the cylinder to reach the switch.
While Not IsActive (OEMTRIG2)
Message ("I'm trying to clamp the tip")
Sleep 10
Wend
REM Once the cylinder is forward it gives the "made it" message.
Message ("Made it")
here is an example from VB Script. Can anyone help me translate this to LUA and if they have time explain it a little bit?
Thanks!!
-Chad
REM M1000 Clamp
DeActivateSignal (output4) 'Turns off the solenoid that unclamps.
ActivateSignal (output3) 'Turns on the solenoid that clamps.
REM Waits for the cylinder to reach the switch.
While Not IsActive (OEMTRIG2)
Message ("I'm trying to clamp the tip")
Sleep 10
Wend
REM Once the cylinder is forward it gives the "made it" message.
Message ("Made it")