Hello Guest it is December 14, 2024, 10:49:26 AM

Author Topic: User LED values not tracking correctly  (Read 8257 times)

0 Members and 1 Guest are viewing this topic.

User LED values not tracking correctly
« on: March 01, 2018, 12:03:50 PM »
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

I'm not a complete idiot...
    there are some parts missing.

Offline TPS

*
  •  2,536 2,536
Re: User LED values not tracking correctly
« Reply #1 on: March 01, 2018, 12:18:19 PM »
had a quick look to your brain.

your wrote:  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 can even find led 1898

led 1897 will never come up , because it's used with a AND for it's own enable
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: User LED values not tracking correctly
« Reply #2 on: March 01, 2018, 12:22:46 PM »
Oops, the brain I included I tried changing the user LED number to check if I might have used a previously used one. In the end it should be the same difference. Both user LED 1898 and 1897 are used for the same purpose in this brain.

As for the AND and user LED 1897 - you would think that is true, but remember I said the user LED is tracking opposite to the value. The intent here is if the user LED is already set, it doesn't try to set it again. Perhaps over kill, but removing it doesn't change the over all behavior of the brain file.

Let me ask you this question. I maybe trying to implement the behavior all wrong. How would you meet the two goals I listed?


-Freeman
« Last Edit: March 01, 2018, 12:29:15 PM by Analias »
I'm not a complete idiot...
    there are some parts missing.
Re: User LED values not tracking correctly
« Reply #3 on: March 01, 2018, 12:30:12 PM »
I posted my reply early by mistake - I have edited it. Please re-read the current edit.
I'm not a complete idiot...
    there are some parts missing.
Re: User LED values not tracking correctly
« Reply #4 on: March 01, 2018, 12:32:07 PM »
When I say the user LED (1898 or 1987) tracks opposite, I mean the second line of the brain attempts to set the user LED correctly (I can see that when watching the brain), but the user LED in the next line actually shows the inverse of the value.

-Freeman
I'm not a complete idiot...
    there are some parts missing.

Offline TPS

*
  •  2,536 2,536
Re: User LED values not tracking correctly
« Reply #5 on: March 01, 2018, 01:14:02 PM »
please post your entire brain.

put two led's on Screen one for led 1898 and one for 1987

 1. If not in MPG mode, switch to MPG mode using button 327.

led to turn on | no Operation |
led 57            | invert           |   AND   ---(button 327)

2. When in MPG mode, cycle through MPG Jog Modes using button 302.

led 57           | no Operation  |
led to Switch  | no Operation  |  AND  ---(button 302)

something like this should do the job

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.