Omron NJ-series User Manual page 234

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

Color#red
 Enumeration Specifications
Item
Enumerator names
Values
Number of enumera-
tors
 Notation to Use an Enumerator as a Function Block or Function Parameter
There are the following two notations that you can use to specify an enumerator for a function or
function block parameter.
Enumerator Only
For a function or function block for which the parameter specifies an enumerator, you can just spec-
ify the enumerator.
Example: Passing an Enumerator to the BCDToBins_WORD Instruction
INT#1234
_BCD1
The Format input variable to the BinToBCDs_WORD is specified as an enumerator.
Therefore, it is necessary to specify only the enumerator.
Enumeration#Enumerator Notation
For a function or function block for which the data type of the parameter is not specified, specifying
just the enumerator is not valid. A building error will occur. To clarify that the parameter is an enu-
merator, the following notation is used: Enumeration#Enumerator.
Example: Passing an Enumerator to the MOVE Instruction
Color#red
The data type of the In input variable is not specified.
To pass an enumerator, use the Enumeration#Enumerator notation.
NJ-series CPU Unit Software User's Manual (W501)
Enumeration Table
FB
Data type
Color
(Color)
Enumerator
IN
red
yellow
green
Variable Table
Variable name
DiscColor
Enumerator names consist of single-byte alphanumeric characters. They are not case
sensitive. A building error will occur if you specify the same enumerator more than
once. A building error will occur if you specify an enumerator with the same name as a
variable in the user program or if you specify an enumerator that already exists in
another enumeration.
Valid range: Integers between 2,147,483,648 and 2,147,483,647
Values do not have to be consecutive.
A compiling error will occur if you specify the same value more than once.
Note You cannot perform size comparisons with enumeration variables. You can only
test to see if the enumerators are the same.
1 to 2,048
BinToBCDs_WORD
EN
ENO
In
Format
MOVE
ENO
EN
Out
In
ColorA
ENUM
Value
0
1
2
Data type
Color
Specification
BCDdata
6 Programming
6
6-47

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents