Operator
Function
+ Addition
- Subtraction
* Multiplication
/ Division
&
Logical And (Bit-wise)
|
Logical Or (On some computers, a solid vertical line appears as a broken line)
( )
Parenthesis
% Modulus
The numeric range for addition, subtraction and multiplication operations is +/-2,147,483,647.9999. The
precision for division is 1/65,000.
Mathematical operations are executed from left to right. Calculations within parentheses have precedence.
Examples:
SPEED=7.5*V1/2
The variable, SPEED, is equal to 7.5 multiplied by V1 and divided
by 2
COUNT=COUNT+2
The variable, COUNT, is equal to the current value plus 2.
RESULT=Val1 -
(@COS[45]*40)
Puts the value of Val1 - 28.28 in RESULT. 40 * cosine of 45
°
is
28.28
K=@IN[1]&@IN[2]
K is equal to 1 only if Input 1 and Input 2 are high
Note:
Mathematical operations can be done in hexadecimal as well as decimal. Just precede hexadecimal
numbers with a $ sign so that the RIO recognizes them as such.
62 Chapter 5 Programming
RIO-47xxx