Author Topic: Getting Script to Run External Cycle Start  (Read 3755 times)

ScottC

  • Posts: 11
    • View Profile
Getting Script to Run External Cycle Start
« on: May 13, 2016, 01:15:18 PM »
In the Mach4 Manual it says that if i load the following script into the Signal Script section i can get an external switch attached to input 1 to work.

This is the code listed in the manual and i loaded into the Signal Script  ... note the first 3 lines were already there when it came up and the rest i added below from the MACH4 Manual. 

I have checked all the diagnostics in both SmartBOB and MACH4 and they indicate my switch is working properly.

I have also attached my profile set up for your review.

CODE:

if SigLib[sig] ~= nil then
    SigLib[sig](state);
end

if (sig == mc.ISIG_INPUT1) and (state == 1) then
    local inst = mc.mcGetInstance()
    mc.mcCntlCycleStart(inst)
end
SignalTable = {
    [mc.ISIG_INPUT1] = function (on_off)
       if (on_off == 1) then
       mc.mcCntlCycleStart(inst)
       end
end
}

thank you
Scott
« Last Edit: May 13, 2016, 01:18:54 PM by ScottC »

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Getting Script to Run External Cycle Start
« Reply #1 on: May 13, 2016, 04:36:18 PM »
Thank you for sending your profile.  I've posted my response on the MachSupport thread, since there are other replies there and this is more a general Mach4 thing.

https://www.machsupport.com/forum/index.php/topic,32533.msg226301.html#msg226301

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.