Logic and Arithmetic SECTION 4 CX-Supervisor Script Language
23
Typical Examples
flag = temp AND speed
The Boolean point 'flag' is assigned a value based on the logic of point 'temp'
AND point 'speed'. If 'temp' and 'speed' are both not zero, 'flag' is set to 1, or
''TRUE''. A value of zero in either 'temp' or 'speed' supplies 'FALSE' or 0 to
'flag'.
IF flag AND temp AND speed THEN
flag = FALSE
ENDIF
The Boolean point 'flag' is assigned 'FALSE', on the condition that 'flag' AND
point 'temp' AND point 'speed' are all not zero. If the condition fails, then 'flag'
is not assigned 'FALSE'.
References
Refer to chapter 4, Control Statements for details of the use of the IF THEN
ELSE/ELSEIF ENDIF statements.
4-2-4 Relational Operators
Syntax
IF expression
or
DO WHILE expression
or
DO UNTIL expression
Remarks
Typical Example
IF fuel < 0 THEN
fuel = 0
ENDIF
Expression The Boolean value to be assigned to pointname or the
Boolean value forming a conditional statement. The
expression includes the following operators with points
and constants:
•And 'AND'.
•Or 'OR'.
• Not 'NOT'.
Argument Description
Argument Description
Expression The value forming a conditional statement. The
expression may include the following operators with
points and constants:
• Greater than '>'.
• Less than '<'.
• Greater than or equal to '>='.
• Less than or equal to '<='.
• Not equal to '!='.
• Equal to '=='.