Logic And Arithmetic; Arithmetic Operators - Omron CX-Supervisor Reference Manual

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

Logic and Arithmetic

4-2
Logic and Arithmetic
4-2-1

Arithmetic Operators

SECTION 4 CX-Supervisor Script Language
Typical Examples
lift = height + rate/5.0
The Integer or Real point 'lift' is assigned the value calculated by the value of
point 'rate' divided by 5, plus the value of point 'height'. Precedence can be
changed by the introduction of parenthesis.
lift = lift - 0.2
The Integer or Real point 'lift' is assigned the value calculated by the current
value of point 'lift' minus 0.2.
distance = distance * time
The Integer or Real point 'distance' is assigned the value calculated by the
current value of point 'distance' multiplied by point 'time'.
References
Refer to chapter 4, Logic and Arithmetic for details of the use of arithmetic and
logic functions. Refer to chapter 4, Punctuation for details of the use of
parenthesis.
Syntax
pointname = expression
Remarks
Argument
Description
pointname
The point name to be assigned a value based on an
arithmetical expression.
expression
The value to be assigned to pointname. The expression
may include the following operators with points and
constants:
Typical Examples
result = 60 + 20/5
The Integer or Real point 'result' is assigned the value calculated by the value
of 20 divided by 5, plus 60.
lift = height + rate/5.0
The Integer or Real point 'lift' is assigned the value calculated by the value of
point 'rate' divided by 5, plus the value of point 'height'. Precedence can be
changed by the introduction of parenthesis.
References
Refer to chapter 4, Punctuation for details of the use of parenthesis.
Addition '+'.
Subtraction '-'.
Multiplication '*'.
Division '/'.
Modulus '%'.
Increment '++'.
Decrement '--'.
21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents