Hello Guest it is July 19, 2024, 10:43:48 AM

Author Topic: Need help getting started Mach4  (Read 4928 times)

0 Members and 1 Guest are viewing this topic.

Offline DazTheGas

*
  •  778 778
  • DazTheGas
Re: Need help getting started Mach4
« Reply #10 on: January 21, 2017, 04:46:44 AM »
OOOppps TYPO ALERT

mc.mcGetInstance is a function and is missing the () at the end, so should of been mc.mcGetInstance() - although if this is in the screen load script then it is already declared at the beginning.

I also noticed I had`nt ended any of the if statements, so heres the same code without the typo`s

Code: [Select]
--------------------------------------------
----Cycle Start buttons on MachMate
--------------------------------------------
local inst = mc.mcGetInstance()

SigLib = {
[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then   
        mc.mcCntlCycleStart(inst)
    end
end,

---------------------------------------------
----Feed Hold Buttons on MachMate
----------------------------------------------
[mc.ISIG_INPUT2] = function (state)
    if (state == 1) then   
        mc.mcCntlFeedHold(inst)
    end
end,

[mc.ISIG_INPUT3] = function (state)
     if (state == 1) then   
        -- do something
     end
end,

[mc.ISIG_INPUT4] = function (state)
    if (state == 1) then   
        -- do something
    end
end,

[mc.ISIG_INPUT5] = function (state)
    if (state == 1) then   
        -- do something
    end
end
} -- etc.............................

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Need help getting started Mach4
« Reply #11 on: January 21, 2017, 12:35:04 PM »
New code worked  ;D :o ::)

Big thank you
Stop Drop and Roll
Re: Need help getting started Mach4
« Reply #12 on: January 24, 2017, 11:42:37 AM »
Here is some pics of my control box
Stop Drop and Roll
Re: Need help getting started Mach4
« Reply #13 on: January 24, 2017, 11:43:40 AM »
More... Not done but we can make motors turn  ;D  :o
Mach4 Is in control... some day I maybe.
« Last Edit: January 24, 2017, 11:45:49 AM by Firechief »
Stop Drop and Roll