231
Mach4 General Discussion / Re: Mach closing randomly 4162
« on: July 10, 2019, 08:47:46 AM »
Steve, the error checking is just the mc.mcsignalwait that I'm using; just to be sure the pneumatic cylinders extend properly.
I'm not formatting any strings in my code; so I don't have to worry about that aspect of the LUA code right now.
I will change my locals to a table. How would I use them after that?
local vars = {
Alarm = mc.mcSignalGetHandle(inst, mc.OSIG_ALARM)
POTUp = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT12)
POTDown = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT13)
CurrentTool = mc.mcToolGetCurrent(inst)
}
mc.mcSignalSetState(Vars.POTDown, 0)
mc.mcSignalSetState(Vars.POTUp, 1)
Is this correct above?
I'm not formatting any strings in my code; so I don't have to worry about that aspect of the LUA code right now.
I will change my locals to a table. How would I use them after that?
local vars = {
Alarm = mc.mcSignalGetHandle(inst, mc.OSIG_ALARM)
POTUp = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT12)
POTDown = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT13)
CurrentTool = mc.mcToolGetCurrent(inst)
}
mc.mcSignalSetState(Vars.POTDown, 0)
mc.mcSignalSetState(Vars.POTUp, 1)
Is this correct above?