Hi,
I was thinking about it and came to this conclusion. When Mach starts at the first pass of the PLC, the code turns the Keyboard jogging ON and then immediately follows with a call to
the KeyboardInputsToggle() function, which turns it off AND sets the button colors.
May I suggest, rather than commenting out the line you edit it:
Code:
mc.mcIoSetState(iReg, 0) --Set register to 0 to ensure KeyboardInputsToggle function will do a enable.
What did here is deliberately set the KeyboardEnable to OFF, and THEN follow with a KeyboardInputsToggle() function which will turn the KeyboardEnable ON and set the colors.
The colors of the button are for our visual convenience, they do not reflect the state of the variable. The KeyboardInputsToggle function toggles the state of the variable BUT ALSO changes the
color of the button to suit our preferred interpretation.
Craig