Hi, I want to make a timer who initialize when EN is True and count while the EN is True, if EN is false then the timer reset
At the end of the timer count the ENO ouput set to TRUE
i have make a FC but i can't initialize correctly the timer, how can i use EN input for initialize or not the timer ??
U #MemoSet // (IN_OUT : BOOL)
SPB LOOP
S #MemoSet // (IN_OUT : BOOL)
L #ValATTE // init value for wait (IN :INT)
T #RegATTE // current value for wait(IN_OUT : INT)
LOOP: L #RegATTE
L 0
<=I
SPB OK
///
U "Pulse 1 sec"
SPBN NOOK
///
L #RegATTE
L 1
-I
T #RegATTE
SPB NOOK
///
OK: NOP 0
SET
SAVE
BE
///
NOOK: NOP 0
CLR
SAVE
BE
Thank's for your HELP
At the end of the timer count the ENO ouput set to TRUE
i have make a FC but i can't initialize correctly the timer, how can i use EN input for initialize or not the timer ??
U #MemoSet // (IN_OUT : BOOL)
SPB LOOP
S #MemoSet // (IN_OUT : BOOL)
L #ValATTE // init value for wait (IN :INT)
T #RegATTE // current value for wait(IN_OUT : INT)
LOOP: L #RegATTE
L 0
<=I
SPB OK
///
U "Pulse 1 sec"
SPBN NOOK
///
L #RegATTE
L 1
-I
T #RegATTE
SPB NOOK
///
OK: NOP 0
SET
SAVE
BE
///
NOOK: NOP 0
CLR
SAVE
BE
Thank's for your HELP