12
« on: November 16, 2016, 02:44:46 PM »
I'm having issues calling the SigLib in the screen load script and for the life of me I don't know what's going on. I have searched these forums and gone through the scripting PDF that is installed with the software( which needs to be fixed!! ) but can't find the answer. Here's what I am wanting to do:
I want to assign a key on the keyboard to perform the same task as the "Button Jog Mode" Button. If I press it, the state will change from "Continuous" to "Incremental" or vice versa.
Here is what I have done so far:
1. Assigned a new input inside of the keyboard plugin and then assigned it to input 63 per the "Quicky 2" video.
2. Verified that the input is working in the diagnostics log.
3. Added the following code to the Screen Load script. It is truncated for simplicity.
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
machEnabled = state;
ButtonEnable()
end,
[mc.ISIG_INPUT0] = function (state)
end,
[mc.ISIG_INPUT63] = function (state)
if (state == 1) then
--CycleStart()
ButtonJogModeToggle()
--else
-- Do something else
--mc.mcCntlFeedHold (0)
end
end,
}
4. Added the following code to the Screen Load script.
if (SigLib[mc.ISIG_INPUT63] ~= nil) then
SigLib[mc.ISIG_INPUT63](state);
end
If I put the information into the PLC script like in the video instead of in the screen load and signal scripts, then the state of the button changes continuously while the button is held down. Please help me as I have searched and cannot find an exact, consice answer. Thank you for looking.