Hello Guest it is April 29, 2024, 03:57:40 AM

Author Topic: External Button Script for 5036  (Read 242 times)

0 Members and 1 Guest are viewing this topic.

External Button Script for 5036
« on: February 23, 2024, 12:56:33 PM »
Hello,
I changed from version 4612 to version 5036. Is it possible that with this version the script for controlling the external cycle start and stop buttons no longer works?
If I insert lines like I always did with version 4612, the machine stops with "Feed Hold" after the automatic tool change. Can anyone explain to me?

Thank you, greetings René

The Code is:

mc.ISIG_INPUT0] = function (state)
     if (state == 1) then   
        CycleStart()
    end
end,

[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then   
        mc.mcCntlFeedHold (inst)
        mc.mcCntlSetLastError(inst, "Do Feed Hold")
    end
end,

[mc.ISIG_INPUT2] = function (state)
     if (state == 1) then 
        CycleStop()
    end
end,
Re: External Button Script for 5036
« Reply #1 on: February 25, 2024, 02:06:49 PM »
I commented out the following lines and now it works again, no idea why.


[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then   
        mc.mcCntlFeedHold (inst)
        mc.mcCntlSetLastError(inst, "Do Feed Hold")
    end
end,

GOOMBA

*
Re: External Button Script for 5036
« Reply #2 on: April 01, 2024, 10:20:23 AM »
I would guess

inst

is nil
ensure you have

inst = mc.mcCntlGetInstance()

before that call and it will likely work.