Influencing variable synchronisation

If an asynchronous V.CH./V.E. variable has to be used for a realtime cycle, synchronicity can be forced for the current NC block.

This is done by adding an “s” to the V node of the variable. It is only valid for the current block. Access to the variable remains asynchronous for all other blocks.

N10 #RT CYCLE [ID=17 SCOPE = PROG]
N20 $IF ONCE Vs.CH.VarTest1 < 1   ; Asynchronous access is                                  ; forced here
N30 Vs.CH.VarTest1 = 1            ; Asynchronous access is                                   ; forced here
N40 $ENDIF
N50 #RT CYCLE END
N60 M30

Synchronisation is also possible outside of a realtime cycle.

N10 #RT CYCLE [ID=17 SCOPE = GLOBAL]
N20 $IF ONCE 1 < 2
N30 V.E.LEVEL_1_A[0].REAL64 = V.E.LEVEL_1_A[0]
N40 $ENDIF
N50 #RT CYCLE END
N60 Vs.E.LEVEL_1_A[0].REAL64 ; synchronous access
N70 M30