EasyManua.ls Logo

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION - Page 157

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
183 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
142
Structured Text (ST Language) Specifications Appendix B
Operators
Note Operations are performed according to the data type.
Therefore, the addition result for INT data, for example, must be a variable using the INT data type. Par-
ticularly care is required when a carry or borrow occurs in an operation for integer type variables. For
example, using integer type variables A=3 and B= 2, if the operation (A/B)*2 is performed, the result of
A/B is 1 (1.5 with the value below the decimal discarded), so (A/B)*2 = 2.
Functions
EXIT Stops repeated processing. EXIT;
RETURN Returns to the point in the program
from which a function block was called.
RETURN;
Operation Symbol Data types supported by operator Priority
1: Lowest
11: Highest
Parentheses and
brackets
(expression),
array[index]
1
Function evaluation identifier Depends on the function (refer to 2-6 Instruction
Support and Operand Restrictions)
2
Exponential ** REAL, LREAL 3
Complement NOT BOOL, WORD, DWORD, LWORD 4
Multiplication * INT, DINT, UINT, UDINT, ULINT, REAL, LREAL 5
Division / INT, DINT, LINT, UINT, UDINT, ULINT, REAL, LREAL 5
Addition + INT, DINT, LINT, UINT, UDINT, ULINT, REAL, LREAL 6
Subtraction INT, DINT, LINT, UINT, UDINT, ULINT, REAL, LREAL 6
Comparisons <, >, <=, >= BOOL, INT, DINT, LINT, UINT, UDINT, ULINT,
WORD, DWORD, LWORD, REAL, LREAL
7
Equality = BOOL, INT, DINT, LINT, UINT, UDINT, ULINT,
WORD, DWORD, LWORD, REAL, LREAL
8
Non-equality <> BOOL, INT, DINT, LINT, UINT, UDINT, ULINT,
WORD, DWORD, LWORD, REAL, LREAL
8
Boolean AND & BOOL, WORD, DWORD, LWORD 9
Boolean AND AND BOOL, WORD, DWORD, LWORD 9
Boolean exclusive
OR
XOR BOOL, WORD, DWORD, LWORD 10
Boolean OR OR BOOL, WORD, DWORD, LWORD 11
Function Syntax
Numerical Functions Absolute values, trigonometric functions, etc.
Arithmetic Functions Exponential (EXPT)
Data type conversion Functions Source data type_TO_New data type (Variable name)
Statement Function Example

Table of Contents

Related product manuals