Chapter 13 Structured Texts Example 6: Examples of incorrect use of the assignment structure are as follows. 13.2.2 Conditional Structure - IF Format Description If the value of Boolean expression 1 is TRUE, Sub-statement 1 will be executed. If the value of Boolean expression 1 is FALSE, Boolean expression 2 will be evaluated. If the values of all the Boolean expressions are FALSE, Other sub-statement will be executed. 13-13 Statement Description D0 := M0 ; The data type of one operand must not be different from the data type of the other operand. D0 := V REAL ; _ The value of a symbol whose data type is REAL can not be assigned to a D device.
V LREAL := V REAL ; _ _ If one operand is a symbol whose data type is REAL, the other operand must be a symbol whose data type is REAL. If one operand is a symbol whose data type is LREAL, the other operand must be a symbol whose data type is LREAL. V DWORD := V TIMER ; _ _ The value of a symbol whose data type is TIMER can not be assigned to a symbol whose data type is DWORD, but can be assigned to a symbol whose data type is WORD. V WORD := HC0 ; _ The value in a HC device can not be assigned to a symbol whose data type is WORD, but can be assigned to a symbol whose data type is DWORD.