Logic and Arithmetic SECTION 4 CX-Supervisor Script Language
22
4-2-2 Bitwise Operators
Syntax
pointname = expression
or
IF expression
or
DO WHILE expression
or
DO UNTIL expression
Remarks
Typical Examples
MSB = value & 128
The Boolean point 'MSB' is set 'TRUE' if the binary representation of 'value'
has the bit set which is worth 128.
Pattern = value << 2
The binary representation of 'value' is shifted left twice, and stored in 'pattern'.
Each Shift Left operation has the effect of doubling the value, so two shifts
quadruple the value.
4-2-3 Logical Operators
Syntax
pointname = expression
or
IF expression
or
DO WHILE expression
or
DO UNTIL expression
Remarks
Argument Description
pointname The pointname to be assigned a value based on the
bitwise operation.
expression The value to be assigned to pointname, or to be
evaluated as a Boolean expression. The expression can
include the following operators with points and constants:
• Bitwise AND, 'BITAND' or '&'.
• Bitwise OR, 'BITOR' or '|'.
• Bitwise XOR, 'XOR' or '^'.
• Bitwise Shift Left, 'SHL' or '<<'.
• Bitwise Shift Right, 'SHR' or '>>'.
Argument Description
Pointname The point name to be assigned a value based on a
logical expression.