Operation
Addition
Subtraction
Comparison
Matches
Does not match
Logical AND
Logical exclusive
OR
Logical OR
Precautions for Correct Use
Precautions for Correct Use
The intended operation may not occur if a function is nested under itself. Always separate the
functions into different statements as shown below.
Example of incorrect notation: out := MyFunc( In1:=x1, In2:=MyFunc( In1:=x2, In2:=x3 ) );
Example of correct notation: temp := MyFunc( In1:=x2, In2:=x3 );
NJ-series CPU Unit Software User's Manual (W501)
Operator
Notation example and evaluated value
+
100+200
Value: 300
100-200
Value: 100
<, >, <=, >= 100<200
If the comparison result is TRUE, the value is set to TRUE.
Otherwise, the value is set to FALSE. In the above exam-
ple, 100 is less than 200, so the value is TRUE.
=
100=200
If the two values match, the value is set to TRUE. Other-
wise, the value is set to FALSE. In the above example, 100
does not equal 200, so the value is FALSE.
< >
100<>200
If the two values do not match, the value is set to TRUE.
Otherwise, the value is set to FALSE. In the above exam-
ple, 100 does not equal 200, so the value is TRUE.
AND,&
Applies 1-bit AND logic to all bits.
The results of 1-bit AND logic are as follows:
0 AND 0 = 0
0 AND 1 = 0
1 AND 0 = 0
1 AND 1 = 1
0101 AND 1100
Value: 0100
XOR
Applies 1-bit exclusive OR logic to all bits.
The results of 1-bit exclusive OR logic are as follows:
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
0101 XOR 1100
Value: 1001
OR
Applies 1-bit OR logic to all bits.
The results of 1-bit OR logic are as follows:
0 OR 0 = 0
0 OR 1 = 1
1 OR 0 = 1
1 OR 1 = 1
0101 OR 1100
Value: 1101
out := MyFunc( In1:=x1, In2:=temp );
6 Programming
Priority
6
7
8
9
6
10
11
6-83