I set an input as a slow counter.
Everytime the input is triggered, the counter increases.
How can I incorporate this fact into any program ?
if counter “increased” then gosub there
I don’t want to put a line for each value (if counter=1 then… if counter=2 then… etc) because I don’t know the max value of this counter.
I just want to run a subprogram everytime the counter changes (by 1 unit)
Didn’t find a clue in the T3000 doc or the forum.
10 IF VAR2 < VAR1 THEN do something
20 VAR2 = VAR1
30 IF+ IN1 THEN VAR1 = VAR1 + 1
Pretty self explanatory, the IF+ statement is your friend for keeping track of transient events.
thank you Maurice, will try this and update.
sorry, I don’t get it
line 10, no probs, a simple test and “do something” by comparing variables
line 20, no probs, after the something is done to disable the “do something”
line 30: IF+ IN1… means (the T3000 doc) " If IN1 is true, and on the previous check it was false"…
IN1 is coming from where and what does it represent ??
the end: OK, I increase the variable by 1, that’s my increased counter
But I’m lost with the IN1 …
In1 is the input to the controller, say a flow switch or mechanical switch wired to the input terminals of the controller. In the screen shot below it is given a label of AIR FLOW SWITCH with the range set to Off/On.
The IF+ statement catches the first positive going event on the input, the logic will trigger only one time when the switch first goes to ON. This is different from the IF statement which will fire continuously till the switch state goes to OFF.
Hope all is clear.
So obvious !
I didn’t catch the IN1 name because I always refer to my own labels in the prg instead of the Input/Output/Variable built-in names…
OK, tested a modified prg (with the IF+) and it works as expected.