I need bit or value to change every time a subroutine is scanned.
ControlLogix environment.
Will S:FS get me there or is that reserved for the first scan after powerup?
KISS
MyCounterINT := MyCounterINT +1;
I usually use the wallclock time for this, the subroutine just copies the value on the first rung to a holding variable.
That's simple, but an Integer does represent a finite value. You'll need to reset occasionally, and be careful not to change the state of the One's Bit when you do.