386
« on: March 21, 2019, 01:58:36 PM »
Well all I am back with another episode of "I just don't get it" or "What the hell did I do wrong this time".
Once again thanks to everyone for all the previous help.
I thought I was getting to be a Mach4 Lua Guru........screeching halt here we are. LOL
I need to check if the motor 0 home switch is active and move off of it.
Through much searching I am unable to find anything that makes sense to me and I can get working.
Here is the code I tried.
local inst = mc.mcGetInstance()
local hsig = mc.mcSignalGetHandle(inst, ISIG_MOTOR0_HOME)
local MatHmLimit = mc.mcSignalGetState(hsig)
if MatHmLimit == 1 then
mc.mcCntlGcodeExecute(inst, "G91 G0 X-5")
mc.mcCntlGcodeExecute(inst, "G90")
end
Any and all suggestions other than jumping off a cliff are greatly appreciated.
Bill