Hello Guest it is April 13, 2021, 10:07:48 PM

Author Topic: Mach4 LED's  (Read 1439 times)

0 Members and 1 Guest are viewing this topic.

Offline HL

  •  10 10
    • View Profile
Re: Mach4 LED's
« Reply #20 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...........

Code: [Select]
if (mc.mcSpindleGetDirection(0) == 1) then
scr.SetProperty("txtBoxCW", "Value", "CW")

elseif (mc.mcSpindleGetDirection(0) == 0) then
scr.SetProperty("txtBoxCW", "Value", "OFF")
scr.SetProperty("txtBoxCW", "Value", "CCW")

local CoolSig = mc.mcSignalGetHandle(0, mc.OSIG_COOLANTON)
local State = mc.mcSignalGetState(CoolSig)
if State == 1 then
    scr.SetProperty("txtBoxCoolant", "Value", "Coolant On")

     scr.SetProperty("txtBoxCoolant", "Value", "Coolant Off")


local MistSig = mc.mcSignalGetHandle(0, mc.OSIG_MISTON)
local State2 = mc.mcSignalGetState(MistSig)
if State2 == 1 then
    scr.SetProperty("txtBoxMist", "Value", "Mist On")
     scr.SetProperty("txtBoxMist", "Value", "Mist Off")

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.
« Last Edit: February 12, 2019, 02:46:11 PM by HL »