Is there a R Trigger for UINT? I have an joystick, when I rotate clockwise the range is 0 to 65535.
The standard R Trigger is 0 to 1 cause BOOL. I want when the joystick rotates clockwise (value goes up) a BOOL. And when I don't rotate the bool is false. This also counterclockwise.
So a R-trigger for UINT.
a FB like R_Trig for integer datatypes does not excist in the standard CODESYS libraries. However, maybe a solution excists in OSCAT basic. Plus I have a small trick which could help.
Thankyou so much it worked!!!! And I got another signal out of the joystick to say if it rotates clockwise or counterclockwise so I could use that. And have add a TOF timer to make the signal more stable. But was not possible without your help so thankyou!
Hello,
Is there a R Trigger for UINT? I have an joystick, when I rotate clockwise the range is 0 to 65535.
The standard R Trigger is 0 to 1 cause BOOL. I want when the joystick rotates clockwise (value goes up) a BOOL. And when I don't rotate the bool is false. This also counterclockwise.
So a R-trigger for UINT.
Or does someone know a other solution?
Thankyou
Hi Edwin,
a FB like R_Trig for integer datatypes does not excist in the standard CODESYS libraries. However, maybe a solution excists in OSCAT basic. Plus I have a small trick which could help.
FB_INT_TRIG
VAR_INPUT
iVAL : INT;
END_VAR
VAR_OUTPUT
Q : BOOL;
VAR
iPrev : INT;
END_VAR
// BODY code
Q := (iVal <> iPrev);
iPrev := iVal;
Goodmorning Hermsen,
Thankyou so much it worked!!!! And I got another signal out of the joystick to say if it rotates clockwise or counterclockwise so I could use that. And have add a TOF timer to make the signal more stable. But was not possible without your help so thankyou!
Kind regards,
Edwin