1
Mach4 General Discussion / Re: Mach4 LED's
« on: February 12, 2019, 02:42:30 PM »
Just in case anyone wants to do the same, here is the code I used.( No guaranty it will work for you, and No it is most certainly not optimized). Use at your own risk...........
Hope this clarifies things somewhat........
P.S. I find programming very boring and repetitive, but sometimes you just have to do thing your way........I guess.
Code: [Select]
if (mc.mcSpindleGetDirection(0) == 1) then
scr.SetProperty("txtBoxCW", "Value", "CW")
elseif (mc.mcSpindleGetDirection(0) == 0) then
scr.SetProperty("txtBoxCW", "Value", "OFF")
else
scr.SetProperty("txtBoxCW", "Value", "CCW")
end
local CoolSig = mc.mcSignalGetHandle(0, mc.OSIG_COOLANTON)
local State = mc.mcSignalGetState(CoolSig)
if State == 1 then
scr.SetProperty("txtBoxCoolant", "Value", "Coolant On")
else
scr.SetProperty("txtBoxCoolant", "Value", "Coolant Off")
end
local MistSig = mc.mcSignalGetHandle(0, mc.OSIG_MISTON)
local State2 = mc.mcSignalGetState(MistSig)
if State2 == 1 then
scr.SetProperty("txtBoxMist", "Value", "Mist On")
else
scr.SetProperty("txtBoxMist", "Value", "Mist Off")
end
Hope this clarifies things somewhat........
P.S. I find programming very boring and repetitive, but sometimes you just have to do thing your way........I guess.