...
- Signal state change to 0 (Mode Select)
- Mode Select Loop START (forever):
- If Se=1, branch to Mode 1: One-Shot
- If Se=2, branch to Mode 2: Flip-Flop
- If Se=3, branch to Mode 3: Burst
- If Se=4, branch to Mode 4: Fast Open
- If Se=5, branch to Mode 5: Fast Close
- Increment heartbeat
- Hold for 100ms
- Mode Select Loop END
...
- Signal state change to 10 (One-Shot Init)
- Load One-Shot speeds (V1)
- Calculate target position using drift of current position (X9)
- Specify One-Shot ISR (J1) to run on Input Trip
- Arm Input Trip (TE=4)
- Signal state change to 11 (One-Shot Loop)
- One-Shot Loop START (forever):
- Increment heartbeat
- Hold for 100ms
- If movement is complete (Sd=90)
- Signal state change to 12 (One-Shot Complete)
- One-Shot Loop END
NOTE: Once in the one-shot loop, you must reset to get back to Mode Select.
One-Shot ISR (J1)
- Copy current position to shadow variables
- If currently in the positive closed position P1
- Move (MA) to negative closed position P2
- Calculate new drift based on stored shadow variables
- Calculate new positive closed position P1 based on drift
- Else (any other position but P1)
- Move (MA) to positive closed position P1
- Calculate new drift based on stored shadow variables
- Calculate new negative closed position P2 based on drift
- EndIf
- Hold until movement complete
- Signal state change to 90 (Toggle movement complete)
- Return
Mode 2: Flip-Flop
- Signal state change to 20 (Flip-Flop Init)
- Load Flip-Flop speeds (V2)
- Calculate target position using drift of current position (X9)
- Specify Flip-Flop ISR (J2) to run on Input Trip
- Arm Input Trip (TE=4)
- Signal state change to 21 (Flip-Flop Loop)
- Flip-Flop Loop START (forever):
- Increment heartbeat
- Hold for 100ms
- If at least one movement is complete (Sd=90)
- Signal state change to 22 (Flip-Flop Loop Active)
- Flip-Flop Loop END
NOTE: Once in the flip-flop loop, you must reset to get back to Mode Select.
Flip-Flop ISR (J2)
This ISR is identical to the One-Shot ISR (J1), with the exception that it re-arms the Input Trip (TE=4) every time it runs.