I am attempting to write a brain to handle the MPG on my Yaskawa pendent. I'm using the PoKeys Pendent Core board from CNC4PC. I'm seeing a weird behavior when user LEDs. I'm not sure if it is a bug or if there is an explanation for it.
I am trying to modify the behavior of the "Handle" button on the Yaskawa to do the following:
1. If not in MPG mode, switch to MPG mode using button 327.
2. When in MPG mode, cycle through MPG Jog Modes using button 302.
I have configured the PoKeys to use two user LEDs. User LED 1899 tracks state of "Handle" button Yaskawa. User LED 1898 acts as a inhibit flag to avoid changing MPG Jog Mode when switching back into MPG mode using button 327. User LED 1898 is turned on and held high with a timer. During that time, the brain for switching MPG Jog Modes (with button 302) is disabled. This avoids both enabling MPG Mode and cycling to the next MPG Jog Mode when switching back from Jog or Rapids on the Yaskawa.
It almost works. The oddity I am seeing is that the user LED 1898 used to inhibit the MPG Jog Mode cycling tracks opposite to what the user LED is set to.
I have included the brain. Yes, I have double and triple checked that nothing else is using the user LEDs and that the PoKeys is set correctly. I have the PoKeys configured to set the user LED 1899 to the state of the "Handle" button on the Yaskawa (Matrix Keyboard 3, 1). Only the brains set the state of the user LED 1898.
Any help or advice would be appreciated.
-Freeman