Omron NT21 Reference Manual page 295

Programmable terminals
Hide thumbs Also See for NT21:
Table of Contents

Advertisement

Mathematical Function
Available Operators
Type
Symbol
Arithmetic
+
operators
*
/
%
Boolean
AND
operators
OR
XOR
Bit-wise
&
operators
|
^
Comparison
<
operators
ope a o s
>
= =
Reference: All of the calculation results are stored in word units, including the results of bool-
Specifying Calculation
Results and Data
The following operators can be used by the mathematical function.
Function
Addition
Subtraction
Multiplication
Division, yields the quotient
Division, yields the remainder
Yields TRUE (1) if the results of both the left formula and
right formula are TRUE (non-zero). Otherwise yields FALSE
(0).
Yields TRUE (1) if the result of the left formula, the right
formula, or both are TRUE (non-zero). Otherwise yields
FALSE (0).
Yields TRUE (1) if the result of one formula is TRUE
(non-zero) and the other is FALSE (0).
Yields FALSE (0) if the results of both formulas are TRUE
(non-zero) or both are FALSE (0).
Logically ANDs the two bits.
Logically ORs the two bits.
Logically XORs the two bits.
Yields TRUE (1) if the result of the left formula is less than
the result of the right formula. Otherwise yields FALSE (0).
Yields TRUE (1) if the result of the left formula is greater
than the result of the right formula. Otherwise yields FALSE
(0).
Yields TRUE (1) if the result of the left formula is equal to
the result of the right formula, otherwise yields FALSE (0).
The operators shown in the table above can be used in any combination. The
operators have no priority order; the order of operations is determined by the pa-
rentheses in the formula pattern.
Example Formula Setting
The following kinds of calculations can be performed by combining formula pat-
terns and operators.
Desired calculation
Scaling calculation (2 X+Y)
Bit inversion of X
Setting the most significant byte of X to 0
Determining whether X is greater than Y
Determining whether 5 X+Y equals 100
Determining whether X is between 15 and 68
The calculations in the table above are examples. a wide variety of calculations
can be made by combining other formula patterns and operators.
ean and comparison operations. The results aren't indicated by turning a particu-
lar bit ON or OFF.
The following storage locations or values can be specified for calculation results
and operands.
Calculation results:
Numeral memory table entries or PC addresses (PT memory)
Operands:
Numeral memory table entries, PC addresses (PT memory), or constants
Section
Result
Result of addition
Result of subtraction
Result of multiplication
Result of division (quotient)
Result of division
(remainder)
TRUE (1) or FALSE (0)
TRUE (1) or FALSE (0)
TRUE (1) or FALSE (0)
Result of logical AND
Result of logical OR
Result of logical XOR
TRUE (1) or FALSE (0)
TRUE (1) or FALSE (0)
TRUE (1) or FALSE (0)
Formula and operators
(2 * X) + Y
X ^ FFFF
H
X & 00FF
H
X > Y
100 = = ((5 * X) + Y)
((X > 15) AND (X < 68)) + 0
2-18
279

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nt631Nt31 seriesNt21 seriesNt631 series

Table of Contents