|expression||in||Expressions of BOOL type.|
; assignment with delay U.Int := 1 ; value assignment WAIT ; waiting for the assignment
; if the action WAIT is successful (no error),
; the value of the object U.Int is certainly 1 IF U.Int = 1 THEN ; value test ; the branch THEN-ELSE is executed whenever the value of the object U.Int is 1 ELSE ; the branch ELSE-ENDIF won't be never executed
U.Int := 2 ; In this case there is not guaranteed that the value of the object U.Int will be 2 ; it depends on the current system load ... IF U.Int = 1 THEN ELSE ENDIF
M.Cmdof I/O tag type, output integer type.
INT _maxWriteCount = 10 ; maximal count of writings INT _writeCount ; writing counter ON ERROR WriteFailed ; error handle _writeCount := 0 WriteRetry: IF _writeCount >= _maxWriteCount GOTO WriteLoopFailed _writeCount := _writeCount + 1 M.Cmd := 1 WAIT ; Successful writing END ; Writing failed _maxWriteCount-times WriteLoopFailed: END ; unsuccessful writing handle WriteFailed: GOTO WriteRetry
In case of assigning a selection, then this is controlled as the whole. Every fractional writing must be well executed. Such a situation occurs, for the assignment of a value of structure type, if references to objects are in individual items.
SD.Reccontains one item of Integer type with the name Int and two items of Object type with the names s
The structure type of the object
Structured variable type is
SD.Rec and its row number is 2.
There are the objects
M.1, M.2, M.3, M.4 - output I/O tags of Integer
RECORD NOALIAS (SD.Rec) _locArr ; local variable of Structure type ; disables references to objects REDIM _locArr ; resizing the array length
; assignment of values to the local variable of Structure type
_locArr^Int := 1 _locArr^Obj1 := 1 _locArr^Obj2 := 2 _locArr^Int := 2 _locArr^Obj1 := 3 _locArr^Obj2 := 4
; assign references to the objects SET SV.Rec ^Obj1 AS M.1 SET SV.Rec ^Obj2 AS M.2 SET SV.Rec ^Obj1 AS M.3 SET SV.Rec ^Obj2 AS M.4 WAIT ; execution of the reference change in the system
P1: SET SV.Rec AS _locArr ; assignment of the whole value WAIT