Variables; Inputting Constants; Operators - Omron CX-PROGRAMMER V8.1 Operation Manual

Function blocks/ structured text
Table of Contents

Advertisement

ST Language Configuration
5-4-2

Variables

5-4-3

Inputting Constants

5-4-4

Operators

Operation
Parentheses and
(expression),
brackets
array[index]
Function evaluation
identifier
Exponential
**
Complement
NOT
Multiplication
*
Division
/
Addition
+
Subtraction
Comparisons
<, >, <=, >=
Equality
=
Non-equality
<>
Boolean AND
&
Boolean AND
AND
Boolean exclusive
XOR
OR
Boolean OR
OR
142
For details on variable specifications and setting methods, refer to the CX-
Programmer Operation Manual (W469).
Numerical values can be expressed in decimal, hexadecimal, octal, or binary,
as shown in the following examples.
Notation
Decimal:
Hexadecimal: 16# followed by numerical value 16#C
Octal:
Binary:
Text string:
Note
Negative hexadecimal, octal, and binary numbers are expressed as 2's com-
plements.
The valid range of INT data is -32,768 to 32,767 in decimal, but 0000 to FFFF
in hexadecimal, so the 2's complement is used for negative integers. For
example, when a value of -10 decimal is set in an INT variable, it will be
expressed as 16#FFF6 in hexadecimal.
Symbol
Depends on the function (refer to Appendix C Func-
tion Descriptions)
REAL, LREAL
BOOL, WORD, DWORD, LWORD
INT, DINT, UINT, UDINT, ULINT, REAL, LREAL
INT, DINT, LINT, UINT, UDINT, ULINT, REAL, LREAL 5
INT, DINT, LINT, UINT, UDINT, ULINT, REAL, LREAL 6
INT, DINT, LINT, UINT, UDINT, ULINT, REAL, LREAL 6
BOOL, INT, DINT, LINT, UINT, UDINT, ULINT,
WORD, DWORD, LWORD, REAL, LREAL
BOOL, INT, DINT, LINT, UINT, UDINT, ULINT,
WORD, DWORD, LWORD, REAL, LREAL
BOOL, INT, DINT, LINT, UINT, UDINT, ULINT,
WORD, DWORD, LWORD, REAL, LREAL
BOOL, WORD, DWORD, LWORD
BOOL, WORD, DWORD, LWORD
BOOL, WORD, DWORD, LWORD
BOOL, WORD, DWORD, LWORD
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. Particularly care is required when a carry or borrow
occurs in an operation for integer type variables. For example, using integer
Method
Numerical value only
8# followed by numerical value
2# followed by numerical value
Place in single quotation marks 'Hello world'
Data types supported by operator
Section 5-4
Example
(for the decimal value 12)
12
8#14
2#1100
Priority
1: Lowest
11: Highest
1
2
3
4
5
7
8
8
9
9
10
11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents