drbitboy
Lifetime Supporting Member
Thanks for the code, you've gone to a lot of effort here.
The only part of it that's unfamiliar to me, is the box TON, which I've never seen before in GX developer, but I realise it's a timer. Cheers for this.
Ta very mooch.
I'm glad it's useful.
Actually what we want is the TOF, fed by the un-inverted bit (see the second half of the Debounce pattern), but feeding a TON with rung state driven by the inverted bit achieves the same result, and I am too lazy to check if GX has TOF.
The next step will be to convert this back to the Set/Reset modality and ensure it matches @parky's code (after fixing the typo). The only differences are that, with Set/Reset,
- there is no seal-in; it is built into the Set/Reset instructions,
- the Reset instruction follows the Set instruction,
- the Start logic feeds the Set instruction,
- The Start logic is everything in parallel with the Seal-in,
- the inverse of the (not-)Stop logic feeds the Reset instruction,
- the (not-Stop) logic is in series with the [Start OR Seal-in] logic.
I am getting more and more convinced that key to understanding the utility of the Start/Stop pattern is seeing that it models hysteresis in time in the output bit's responses to two asynchronous events:
- An initial event starts it i.e. the output bit becomes 1
- A later event stops it i.e. the output bit becomes 0
Last edited: