ExST assignment as expression
In ExST, TwinCAT allows the use of assignments as expressions, in extension to the IEC 61131-3 standard.
Examples:
nVarInt1 := nVarInt2 := nVarInt3 + 9; | (*nVarInt1 and nVarInt2 obtain the value of nVarInt3 + 9*) |
fVarReal1 := fVarReal2 := nVarInt; | (*fVarReal1 and fVarReal2 obtain the value of nVarInt*) |
nVarInt:= fVarReal1:= nVarInt; | (*incorrect assignment, the data types do not match!*) |
IF b := (i = 1) THEN | (*b obtains the value of the Boolean expression i = 1 and is then checked in the if query*) |