Question: 0-ms 0.5-ms ms in- ms in- ms in-

Answer:
incre- incre- cre- cre- cre-
ments ments ments ments ments
Communications 40,000 40,000 20,000 12,000 3,000 1,000 3,000 3,000 pps 6,000 pps
bandwidth used pps*5 pps*5 pps*5 pps*5 pps pps pps
(pps)*4
*1. The maximum number of tags is given for the following conditions.
• All tag sets contain eight tags.
• The maximum number of tag sets (32) is registered.
*2. When tag sets that exceed total of 40 are set, a Number of Tag Sets for Tag Data Links Exceeded (840E0000 hex) event occurs.
*3. To use data of 505 bytes or more, large forward open (an optional CIP specification) should be supported. The SYSMAC CS/CJ-series
Units support large forward open, and if you use nodes from other companies, confirm that the devices also support it.
*4. Here, pps means “packets per second” and indicates the number of packets that can be processed in one second.
*5. If the two EtherNet/IP ports are used simultaneously, the maximum communications data size means the maximum data size of the
total of the two ports.
*6. An NX-EIP201 can only be used with the NX502 CPU Unit. However, check the effect on task execution time because it increases I/O
refreshing time.
 Specifying Tags
When you assign a tag to a device, you can specify the device with its network variable or I/O
memory address. Some CPU Units, however, may not support both of these methods.
Communications with such CPU Units are possible though, regardless of whether the I/O memory
address or network variable is specified for the tag assignment.
The supported tag specification methods for each CPU Unit are listed in the table below.
Yes: Supported, No: Not supported
CPU Unit Network Configura- Specifying Specifying
tor with network with I/O memo-
EtherNet/IP Unit
hardware list name variable ry address
NX-series CPU Unit --- NX701 Yes No
NX502 Yes Yes *1
NX102 Yes Yes *1*2
NX1P2££££ Yes Yes *1*2
NJ-series CPU Unit --- NJ501-££££ Yes Yes*1
NJ301-££££
NJ101
CJ1W-EIP21*3 CJ1W-EIP21 (NJ) Yes Yes*1
CJ1W-EIP21S*4 CJ1W-EIP21S (NJ) Yes Yes*1
CJ2H-CPU6£-EIP --- CJ2B-EIP21 Yes Yes
CJ1W-EIP21 CJ1W-EIP21 (CJ2) Yes Yes
CJ1W-EIP21S CJ1W-EIP21S (CJ2) Yes Yes
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 6-93
6-4
Tag
Data
Links
with
Other
Models
6
6 Tag Data Link Functions
CPU Unit Network Configura- Specifying Specifying
tor with network with I/O memo-
EtherNet/IP Unit
hardware list name variable ry address
CJ2H-CPU6£ CJ1W-EIP21 CJ1W-EIP21 (CJ2) Yes*5 Yes
CJ1W-EIP21S CJ1W-EIP21S (CJ2) Yes*5 Yes
CJ2M-CPU3£ --- CJ2M-EIP21 Yes Yes
CJ1W-EIP21 CJ1W-EIP21 (CJ2) Yes Yes
CJ1W-EIP21S CJ1W-EIP21S (CJ2) Yes Yes
CJ2M-CPU1£ CJ1W-EIP21 CJ1W-EIP21 (CJ2) Yes*6 Yes
CJ1W-EIP21S CJ1W-EIP21S (CJ2) Yes*6 Yes
CJ1 CPU Unit CJ1W-EIP21 CJ1W-EIP21 No Yes
CJ1W-EIP21S CJ1W-EIP21S No Yes
CS1 CPU Unit CS1W-EIP21 CS1W-EIP21 No Yes
CS1W-EIP21S CS1W-EIP21S No Yes
*1. To specify an I/O memory address for tag assignment, do not specify the address directly. Instead, cre-
ate a variable with an AT specification of the I/O memory address on the Sysmac Studio, and then speci-
fy the variable for the tag.
*2. For NX102 and NX1P2 CPU Units, you need to set memory used for CJ-series Unit to use the I/O mem-
ory address. For details on memory settings used for CJ-series Unit, refer to the NJ/NX-series CPU Unit
Software User's Manual (Cat. No. W501).
*3. The CJ1W-EIP21 can be mounted to the NJ-series CPU Unit in the following combinations.
• CJ1W-EIP21: Unit version 2.1 or later
• NJ-series CPU Unit: Unit version. 1.01 or later
• Sysmac Studio: Version 1.02 or higher
*4. The CJ1W-EIP21S can be mounted to the NJ-series CPU Unit in the following combinations.
• CJ1W-EIP21S: Lot. number: 241001£ or later
• NJ-series CPU Unit: Unit version 1.67 or later
• Sysmac Studio: Version 1.60 or higher
*5. A CJ2H-CPU6£ with unit version 1.6 or later is required to use this function.
*6. A CJ2M-CPU1£ with unit version 2.2 or later is required to use this function.
6-94 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7
CIP Message Communications
7-1 Overview of the CIP Message Communications Service...........................7-3
7-1-1 Overview of the CIP Message Communications Service................................7-3
7-1-2 Message Communications Service Specifications..........................................7-3
7-2 Client Function of CIP Message Communications.....................................7-4
7-2-1 Overview.........................................................................................................7-4
7-2-2 CIP Communications Instructions...................................................................7-4
7-2-3 Using CIP Communications Instructions.........................................................7-5
7-2-4 Route Path......................................................................................................7-6
7-2-5 Request Path (IOI)........................................................................................7-16
7-2-6 Service Data and Response Data.................................................................7-20
7-2-7 Sample Programming for CIP Connectionless (UCMM) Message
Communications............................................................................................7-22
7-2-8 Sample Programming for CIP Connection (Class 3) Message Com-
munications...................................................................................................7-27
7-2-9 Operation Timing...........................................................................................7-34
7-2-10 Response Codes...........................................................................................7-35
7-3 Server Function of CIP Message Communications..................................7-39
7-3-1 CIP Message Structure for Accessing CIP Objects......................................7-40
7-3-2 CIP Message Structure for Accessing Variables...........................................7-41
7-4 Specifying Request Path.............................................................................7-42
7-4-1 Examples of CIP Object Specifications.........................................................7-42
7-4-2 Examples of Variable Specifications.............................................................7-43
7-4-3 Logical Segment............................................................................................7-43
7-4-4 Data Segment...............................................................................................7-43
7-4-5 Specifying Variable Names in Request Paths...............................................7-44
7-5 CIP Object Services.....................................................................................7-48
7-5-1 CIP Objects Sent to the Built-in EtherNet/IP Port..........................................7-48
7-5-2 Identity Object (Class ID: 01 hex)..................................................................7-48
7-5-3 NX Configuration Object (Class ID: 74 hex)..................................................7-53
7-5-4 TCP/IP Interface Object (Class ID: F5 hex)..................................................7-74
7-5-5 Ethernet Link Object (Class ID: F6 hex)........................................................7-77
7-5-6 Controller Object (Class ID: C4 hex).............................................................7-83
7-6 Read and Write Services for Variables.......................................................7-85
7-6-1 Read Service for Variables............................................................................7-85
7-6-2 Write Service for Variables............................................................................7-86
7-7 Variable Data Types......................................................................................7-89
7-7-1 Data Type Codes...........................................................................................7-89
7-7-2 Common Format...........................................................................................7-89
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-1
7
7 CIP Message Communications
7-7-3 Elementary Data Types.................................................................................7-90
7-7-4 Derived Data Types.......................................................................................7-91
7-2 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
7-1 Overview of the CIP Message Com-
munications Service
7-1-1 Overview of the CIP Message Communications Service
CIP commands can be sent to devices on the EtherNet/IP network whenever they are required.
You execute CIP_SEND instructions in a program in the NJ/NX-series CPU Unit to send CIP com-
mands, such as those to read and write data and to receive the responses.
You can use CIP messages from the client to read and write memory in the Controller with the server
without adding any special programming to the user program of the Controller with the server.
Built-in
NJ/NX-series
Controller EtherNet/IP or host computer
port
CIP command
EtherNet/IP
CIP response
Built-in
NJ/NX-series EtherNet/IP
Controller port
7-1-2 Message Communications Service Specifications
Item Specification
Message type Either of the following can be selected.
CIP UCMM connectionless messages
CIP class 3 connection messages
Execution method CIPSend (Send Explicit Message Class 3) instruction or CI-
PUCMMSend (Send Explicit Message UCMM) instruction
Data contents Sending required CIP commands and receiving responses
Communications parameters Message type, timeout value, and route path specification
Maximum length per Non-connection type 502 bytes
connection (UCMM)
Connection type • Using Forward_Open
(class 3) 502 bytes
• Using Large_Forward_Open
NX701 CPU Unit: 8,192 bytes
NX502 CPU Unit: 1,994 bytes
NX102 CPU Unit: 1,994 bytes
NX1P2 CPU Unit: 1,994 bytes
NJ-series CPU Unit: 1,994 bytes
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-3
7-1
Overview
of
the
CIP
Message
Communications
Service
7
7-1-1
Overview
of
the
CIP
Message
Communications
Service
7 CIP Message Communications
7-2 Client Function of CIP Message Com-
munications
7-2-1 Overview
The NJ/NX-series CPU Units can send a CIP message to an external device to request a service by
specifying an internal object of the device which supports the server function of CIP message commu-
nications.
This is called the client function of CIP message communications.
The NJ/NX-series CPU Units execute CIP communications instructions in the user program and send
CIP messages. With those CIP messages, you can read and write variables of an NJ/NX-series CPU
Unit on the EtherNet/IP network.
NJ/NX-series NJ/NX-series
CPU Unit Built-in EtherNet/IP port CPU Unit Built-in EtherNet/IP port
CIP_SEND CIP communications instruction Specify a variable name.
EtherNet/IP
Specify the CIP communications parameters,
such as the route path, as well as the service
code, the request path, and the service data.
7-2-2 CIP Communications Instructions
The following CIP communications instructions are available.
For details on CIP communications instructions, refer to the NJ/NX-series Instructions Reference
Manual (Cat. No. W502).
Instruc- Communica-
Name Description
tions tions method
CIPUCMM- Read Variable Reads the value of a variable with a Network Publish at- CIP UCMM
Read UCMM Explicit tribute from the specified remote Controller on the CIP connectionless
network and stores the value in a variable at the local message
Controller.
CIPUCMM- Write Variable Writes the value of a variable at the local Controller to a
Write UCMM Explicit variable with a Network Publish attribute at the specified
remote Controller on the CIP network.
CIPUCMM- Send Explicit Mes- Sends a specified CIP command to the specified remote
Send sage UCMM Controller on the CIP network.
Refer to 7-2-10 Response Codes on page 7-35 and
7-5 CIP Object Services on page 7-48 for information
on the service codes and response codes that are used
with the NJ/NX-series CPU Units.
7-4 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Instruc- Communica-
Name Description
tions tions method
CIPOpen Open CIP Class 3 Opens a CIP class 3 connection (Large_Forward_Open) CIP class 3
Connection with the specified remote node. connection
(Large_For- message
ward_Open)
CIPOpen- Open CIP Class 3 Opens a CIP class 3 connection with the specified re-
WithData- Connection with mote node that allows class 3 explicit messages of the
Size Specified Data Size specified data length or shorter to be sent and received.
CIPRead Read Variable Reads the value of a variable with a Network Publish at-
Class 3 Explicit tribute from the specified remote Controller on the CIP
network and stores the value in a variable at the local
Controller.
CIPWrite Write Variable Writes the value of a variable at the local Controller to a
Class 3 Explicit variable with a Network Publish attribute at the specified
remote Controller on the CIP network.
CIPSend Send Explicit Mes- Sends a specified class 3 CIP command to the specified
sage Class 3 remote Controller on the CIP network.
Refer to 7-2-10 Response Codes on page 7-35 and
7-5 CIP Object Services on page 7-48 for information
on the service codes and response codes that are used
with the NJ/NX-series CPU Units.
CIPClose Close CIP Class 3 Closes the CIP class 3 connection that is specified by
Connection the handle.
Version Information
A CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or higher are re-
quired to use the CIPOpenWithDataSize instruction.
7-2-3 Using CIP Communications Instructions
CIP message communications include the following processes.
If CIP class 3 connections are used, the open and close processes are required before and after the
data is sent and received.
Process Description Instruction
Open process Execute this process before you use a CIP message. CIPOpen
(only for CIP class 3 con- Open processing is continued until a CIP class 3 con- CIPOpenWithData-
nections)*1 nection is established. Size
Sending and receiving varia- This process is used to read and write data for specified CIPUCMMRead
ble data*2 variables with the Network Publish attributes. CIPUCMMWrite
CIPRead
CIPWrite
Sending CIP commands You can set the required CIP command. CIPUCMMSend
CIPSend
Close process This process closes the connection. CIPClose
(only for CIP class 3 con-
nections)
*1. The maximum number of connection handles that you can obtain simultaneously through the opening proc-
ess is 32. Even if a connection is disconnected for a timeout, the handle is not released. Execute the CIP-
Close instruction to close the connection.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-5
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-3
Using
CIP
Communications
Instructions
7 CIP Message Communications
*2. Addresses in memory for CJ-series Units (e.g., D0000) cannot be specified directly. To access memory for CJ-
series Units, access a variable with an AT specification. (Accessing is possible only for NJ-series CPU Units.)
Local Controller Remote Controller
(1) Specifies
the variable.
CIPRead
Execute
Handle (2) Reads data
‘VAR_1’ SrcDat starting at D0000 D00000
5 Size for the number of Allocated. D00001
elements.
DstDat VAR : ARRAY[0..9] OF WORD AT %D0 D00002
MyArray Network Publish attribute …….
WORD[10]
RcvSize D00009
*
Addresses in the memory for
* To access memory for CJ-series Units in
CJ-series Units are assigned to the
the local Controller, you also must assign
variable and the variable is given
the required addresses to variables.
the Network Publish attribute.
MyArray : ARRAY[0..9] OF WORD:
MyArray[0] : Value of D00000 in remote Controller
Value of D00001 in remote Controller
Value of D00002 in remote Controller
…….
MyArray[9] : Value of D00009 in remote Controller
Precautions for Correct Use
You can execute up to 32 CIP communications instructions at the same time regardless of the
instruction types.
Use exclusive control in the user program so that the number of CIP communications instruc-
tions executed at the same time does not exceed the above number.
7-2-4 Route Path
The route path indicates the path from the local CPU Unit to the remote Controller on the network.
Routing for CIP communications instructions is performed based on the route path.
Route Path Notation
The EPATH data type is used to give route paths. The basic format is shown below.
Network_type_number\Destination_address
 NX701 CPU Unit, NX502 CPU Unit, and NX102 CPU Unit
Two internal CPU Units are provided (each with a unique unit address) to control the two built-in
EtherNet/IP ports.
• For the built-in EtherNet/IP port 1: CPU Unit with a unit address of 00 hex (CPU #00)
• For the built-in EtherNet/IP port 2: CPU Unit with a unit address of 01 hex (CPU #01)
The RoutePath input variable for the CIP communications instructions is used to distinguish the two
CPU Units (CPU #00 and CPU #01) and send the CIP communications instructions.
7-6 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Route path for sending a CIP communications instruction
• The CIP communications instruction is issued from CPU #00. (a)
• The output from the built-in EtherNet/IP port 2 is routed from CPU #00 via CPU #01. (b) to (c)
NX701, NX502, or NX102 CPU Unit NX701, NX502, or NX102 CPU Unit
Backplane
CPU#00 port (#01) CPU#01
(Unit address 00 hex) (Unit address 01 hex)
(b)
(a) (c)
Communications Communications
port (#02) port (#02) IP address : IP address :


Question: 168.250.2 192.168.251.2

Answer:
Built-in EtherNet/IP Built-in EtherNet/IP
port 1 port 2
Route path specifications
Route no-
Route Network type number (hexadeci- Destination address (hexadeci-
tation
mal) mal)
Output from the (a) #02 (communications port) IP address
built-in
EtherNet/IP port
1
Output from the (b) #01 (backplane port) #01 (unit address of the CPU Unit)
built-in (CPU #01 for built-in EtherNet/IP
EtherNet/IP port port 2 communications)
2 (c) #02 (communications port) IP address
Route Path
Output from built-in EtherNet/IP port 1: 02\192.168.251.2
(a)
Output from built-in EtherNet/IP port 2: 01\#01 \02\192.168.250.2
(b) (c)
• The CPU Units (CPU#00 and CPU#01), which control the respective built-in EtherNet/IP ports,
can be accessed via the backplane port regardless of whether the input is routed via the Ether-
Net/IP port 1 or 2.
Example: Inputting an Ethernet Link object (class ID: F6 hex) to the built-in EtherNet/IP port 1 of
the remote NX701 CPU Unit, and reading out the settings and status of the built-in EtherNet/IP port


Question: NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-7

Answer:
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-4
Route
Path
7 CIP Message Communications
NX701 CPU Unit
Backplane
CPU#00 port (#01) CPU#01
(Unit address 00 hex) (Unit address 01 hex)
(b)
Communications Communications
port (#02) port (#02)
Built-in EtherNet/IP Built-in EtherNet/IP
IP address : port 1 port 2


Answer:
(a)
Route Path : 02\192.168.250.1 \01\#01
(a) (b)
 NX1P2 CPU Unit
As shown in the table below, the network type number and the destination address are determined
depending on whether the output is routed (1) to a Unit on the CPU Rack or (2) from a communica-
tions port on a Communications Unit.
Network type number (hexadec- Destination address (hexadeci-
Route
imal) mal)
(1) Output to a Unit on the CPU #01 (backplane port) Unit address of the destination
Rack Unit (Refer to Additional Informa-
tion below.)
(2) Output from a communications #02 (built-in EtherNet/IP port) IP address
port on a Communications Unit
NX1P2
CPU Unit
(1)
BackPlane
Port (#01)
Communications
IP address
port (#02)
(2)


Question: When Routing the Output to a Unit on the CPU Rack

Answer:
Route the output to the backplane port for the network with the CPU Rack, with the Unit ad-
dress of the destination Unit specified as the destination address.


Question: When Routing the Output from a Communications Port on a Communications Unit

Answer:
Route the output to an EtherNet/IP port, with the IP address specified as the destination node
address.
7-8 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
Additional Information
Unit Addresses
Unit addresses are used to identify each of devices connected to a single node on a network.
Unit addresses are set as shown below.
• CPU Unit: 00 hex
 NJ-series CPU Unit
As shown in the table below, the network type number and the destination address are determined
depending on whether the output is routed (1) to a Unit on the CPU Rack or (2) from a communica-
tions port on a Communications Unit.
Network type number (hexadec- Destination address (hexadeci-
Route
imal) mal)
(1) Output to a Unit on the CPU #01 (backplane port) Unit address of the destination
Rack Unit (Refer to Additional Informa-
tion below.)
(2) Output from a communications #02 (built-in EtherNet/IP port) IP address
port on a Communications Unit
(1)
IP address
(2)
sserdda
tinU
7 CIP Message Communications
NJ-series CPU Unit
Backplane
port #01
Communications
port (#02)


Question: When Routing the Output to a Unit on the CPU Rack

Answer:
Route the output to the backplane port for the network with the CPU Rack, with the Unit ad-
dress of the destination Unit specified as the destination address.


Question: When Routing the Output from a Communications Port on a Communications Unit

Answer:
Route the output to an EtherNet/IP port, with the IP address specified as the destination node
address.
Additional Information
Unit Addresses
Unit addresses are used to identify each of devices connected to a single node on a network.
Unit addresses are set as shown below.
• CPU Unit: 00 hex, 01 hex
• CPU Bus Units (EtherNet/IP Units): Unit number + 10 hex
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-9
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-4
Route
Path
7 CIP Message Communications
Route Path Notation Examples
 NX701 CPU Unit, NX502 CPU Unit, and NX102 CPU Unit
The route path notation is different for communications using the built-in EtherNet/IP port 1
(CPU#00) and for communications using the built-in EtherNet/IP port 2 (CPU#01).
This section provides examples of route paths.
This example explains communications via an NX-series CPU Unit.


Question: Using the built-in EtherNet/IP port 1 (local CPU #00)

Answer:
(Local CPU #00 to destination CPU #00)
NX701, NX502, or NX102 CPU Unit NX701, NX502, or NX102 CPU Unit
CPU#00 CPU#01 CPU#00 CPU#01
(Unit address 00 hex) (Unit address 01 hex) (Unit address 00 hex) (Unit address 01 hex)
Communications Communications Communications Communications
port (#02) port (#02) port (#02) port (#02)
Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP
port 1 port 2 port 1 port 2
(a) IP address :


Answer:
a) Local CPU #00 to destination IP address
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the destination IP address
Route Path : 02\192.168.250.2


Question: Using the built-in EtherNet/IP port 2 (local CPU #01)

Answer:
(Local CPU #00 to destination CPU #01 via local CPU #01)
NX701, NX502, or NX102 CPU Unit NX701, NX502, or NX102 CPU Unit
Backplane port
CPU#00 (#01) CPU#01 CPU#00 CPU#01
(Unit address 00 hex) (Unit address 01 hex) (Unit address 00 hex) (Unit address 01 hex)
(a)
Communications Communications Communications Communications
port (#02) port (#02) port (#02) port (#02)
Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP
port 1 port 2 port 1 port 2
(b)
IP address :


Answer:
a) Local backplane to local CPU #01
• Network type number: "01" (Output to Backplane port)
• Destination address: "#01" (CPU#01) Note: This is in order to output using the sender IP
address of the built-in EtherNet/IP port 2.
b) Local CPU #01 to destination IP address
7-10 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the destination IP address
Route Path : 01\#01 \02\192.168.251.2
(a) (b)


Question: Communicating with the destination built-in EtherNet/IP port 2 (destination CPU #01) via the

Answer:
destination built-in EtherNet/IP port 1 (destination CPU #00)
(Local CPU #00 to destination CPU #01 via destination CPU #00)
NX701, NX502, or NX102 CPU Unit NX701, NX502, or NX102 CPU Unit
Backplane port
CPU#00 CPU#01 CPU#00 (#01) CPU#01
(Unit address 00 hex) (Unit address 01 hex) (Unit address 00 hex) (Unit address 01 hex)
(b)
Communications Communications Communications Communications
port (#02) port (#02) port (#02) port (#02)
Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP
port 1 port 2 port 1 port 2
(a) IP address :


Answer:
a) Local CPU #00 to destination IP address
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the destination IP address
b) Destination backplane to destination CPU #01
• Network type number: "01" (Output to Backplane port)
• Destination address: "#01" (CPU#01)
Route Path : 02\192.168.250.2 \01\#01
(a) (b)


Question: Communicating with the destination built-in EtherNet/IP port 1 (destination CPU #00) via the

Answer:
destination built-in EtherNet/IP port 2 (destination CPU #01)
(Local CPU #00 to destination CPU #00 via destination CPU #01)
NX701, NX502, or NX102 CPU Unit NX701, NX502, or NX102 CPU Unit
Backplane port Backplane port
CPU#00 (#01) CPU#01 CPU#00 (#01) CPU#01
(Unit address 00 hex) (Unit address 01 hex) (Unit address 00 hex) (Unit address 01 hex)
(a) (c)
Communications Communications Communications Communications
port (#02) port (#02) port (#02) port (#02)
Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP
port 1 port 2 port 1 port 2
(b)
IP address :


Answer:
a) Local backplane to local CPU #01
• Network type number: "01" (Output to Backplane port)
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-11
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-4
Route
Path
7 CIP Message Communications
• Destination address: "#01" (CPU#01) Note: This is in order to output using the sender IP
address of the built-in EtherNet/IP port 2.
b) Local CPU #01 to destination IP address
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the destination IP address
Route Path : 01\#01 \02\192.168.251.2
(a) (b)
c) Destination CPU #01 to destination CPU #00
• Network type number: "01" (Output to Backplane port)
• Destination address: "#00" (CPU#00)
Route Path : 01\#01 \02\192.168.251.2\01\#00
(a) (b) (c)


Question: Using an NX701 CPU Unit, NX502 CPU Unit, or NX102 CPU Unit as a relay Unit (the built-in

Answer:
EtherNet/IP port 1 to the built-in EtherNet/IP port 2)
(Local CPU #00 to destination CPU #00 via relay CPU #00 and relay CPU #01)
NX701, NX502, or NX102 CPU Unit NX701, NX502, or NX102 CPU Unit (Relay Unit) NX701, NX502, or NX102 CPU Unit
Backplane
CPU#00 CPU#01 CPU#00 port (#01) CPU#01 CPU#00 CPU#01
(Unit address (Unit address (Unit address (Unit address (Unit address (Unit address
00 hex) 01 hex) 00 hex) (b) 01 hex) 00 hex) 01 hex)
Communications Communications Communications Communications Communications Communications
port (#02) port (#02) port (#02) port (#02) port (#02) port (#02)
Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP
port 1 port 2 port 1 port 2 port 1 port 2
IP address : IP address :
(a) 192.168.250.2 (c) 192.168.252.3
a) Local CPU #00 to relay IP address
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the relay IP address
b) Relay backplane to relay CPU #01
• Network type number: "01" (Output to Backplane port)
• Destination address: "#01" (CPU#01) Note: This is in order to output using the sender IP
address of the built-in EtherNet/IP port 2.
c) Relay CPU #01 to destination IP address
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the destination IP address
Route Path : 02\192.168.250.2\01\#01\02\192.168.252.3
(a) (b) (c)


Question: Using an NX701 CPU Unit, NX502 CPU Unit, or NX102 CPU Unit as a relay Unit (the built-in

Answer:
EtherNet/IP port 2 to the built-in EtherNet/IP port 1)
(Local CPU #00 to destination CPU #00 via local CPU #01, relay CPU #01, and relay CPU #00)
7-12 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
NX701, NX502, or NX102 CPU Unit NX701, NX502, or NX102 CPU Unit (Relay Unit) NX701, NX502, or NX102 CPU Unit
Backplane Backplane
CPU#00 port (#01) CPU#01 CPU#00 port (#01) CPU#01 CPU#00 CPU#01
(Unit address (Unit address (Unit address (Unit address (Unit address (Unit address
00 hex) (a) 01 hex) 00 hex) (c) 01 hex) 00 hex) 01 hex)
Communications Communications Communications Communications Communications Communications
port (#02) port (#02) port (#02) port (#02) port (#02) port (#02)
Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP Built-in EtherNet/IP
port 1 port 2 port 1 port 2 port 1 port 2
IP address : IP address :


Question: 168.251.2 192.168.252.3

Answer:
(d)
(b)
a) Local backplane to local CPU #01
• Network type number: "01" (Output to Backplane port)
• Destination address: "#01" (CPU#01) Note: This is in order to output using the sender IP
address of the built-in EtherNet/IP port 2.
b) Local CPU #01 to destination IP address
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the destination IP address
c) Relay backplane to relay CPU #00
• Network type number: "01" (Output to Backplane port)
• Destination address: "#00" (CPU#00) Note: This is in order to output using the sender IP
address of the built-in EtherNet/IP port 1.
d) Relay CPU #00 to destination IP address
• Network type number: "02" (Output to the communications port)
• Destination address: Specify the destination IP address
Route Path : 01\#01\02\192.168.251.2\01\#00\02\192.168.252.3
(a) (b) (c) (d)
 NX1P2 CPU Unit
This section provides examples of route paths.


Question: Communicating between Built-in EtherNet/IP Ports

Answer:
Example: Communicating between the built-in EtherNet/IP ports on CPU Unit 1 and CPU
Unit 2
CPU Unit #1 CPU Unit #2
CPU#00
(Unit address 00 hex)
Communications port (#02) IP address


Answer:
Built-in EtherNet/IP port Built-in EtherNet/IP port
Communications port (#02)
• Network type number: "#02" (Output the command via the built-in EtherNet/IP port)
• Destination address: Specify the destination IP address
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-13
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-4
Route
Path
7 CIP Message Communications
• Route path: 02\192.168.250.2
 NJ-series CPU Unit
The notation of the route path is different for communications on the built-in EtherNet/IP port and
for communications on an EtherNet/IP Unit.
This section provides examples of route paths.


Question: Communicating between Built-in EtherNet/IP Ports

Answer:
Example: Communicating between the built-in EtherNet/IP ports on CPU Unit 1 and CPU
Unit 2
CPU Unit #1 CPU Unit #2
CPU#00
(Unit address 00 hex)
Communications port (#02) IP address


Answer:
Built-in EtherNet/IP port Built-in EtherNet/IP port
Communications port (#02)
• Network type number: "#02" (Output the command via the EtherNet/IP port)
• Destination address: Specify the destination IP address
• Route path: 02\192.168.250.2


Question: Communicating from a Built-in EtherNet/IP Port to an EtherNet/IP Unit

Answer:
Example: Communicating from the built-in EtherNet/IP port on CPU Unit 1 to CPU Unit 2 via
the EtherNet/IP Unit mounted to CPU Unit 2
CPU Unit 1 CPU Unit 2 EtherNet/IP Unit 2
Unit address Backplane
00 hex port #01
Communications
port (#02)
IP address:


Answer:
Built-in EtherNet/IP port EtherNet/IP port
a) CPU Unit 1 to EtherNet/IP Unit 2
• Network type number: "#02" (Output the command via the EtherNet/IP port)
• Destination address: Specify the destination IP address
b) EtherNet/IP Unit 2 to CPU Unit 2
• Network type number: "#01" (Output the command via the internal backplane port)
• Destination address: "#00" (Unit address of the CPU Unit)
7-14 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Route path : 02\192.168.250.2\01\#00
(1) (2)


Question: Communicating between EtherNet/IP Units

Answer:
Example: Communicating via EtherNet/IP Units mounted to CPU Unit 1 and CPU Unit 2
CPU Unit 1 EtherNet/IP Unit 1 CPU Unit 2 EtherNet/IP Unit 2
Unit address Unit address Backplane
11 hex 00 hex port #01
Backplane
port #01
IP address:


Answer:
Communications
EtherNet/IP port
port (#02)
a) CPU Unit 1 to EtherNet/IP Unit 1
• Network type number: "#01" (Output the command via the internal backplane port)
• Destination address: "#11" (Unit address of EtherNet/IP Unit (Unit number: 1+10 hex))
b) EtherNet/IP Unit 1 to EtherNet/IP Unit 2
• Network type number: "#02" (Output the command via the EtherNet/IP port)
• Destination address: Specify the destination IP address
c) EtherNet/IP Unit 2 to CPU Unit 2
• Network type number: "#01" (Output the command via the internal backplane port)
• Destination address: "#00" (Unit address of the CPU Unit)
Route path : 01\#11\02\192.168.250.2\01\#00
(1) (2) (3)
Version Information
• You can use the CJ1W-EIP21 EtherNet/IP Unit mounted to an NJ-series Controller with a
CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher.
• The CJ1W-EIP21S can be used in the following combinations.
a) CJ1W-EIP21S: Lot. number: 241001£ or later
b) NJ-series CPU Unit: Unit version 1.67 or later
c) Sysmac Studio: Ver.1.60 or higher


Question: Accessing via a Relay Node

Answer:
Example: Communicating from CPU Unit 1 to CPU Unit 3 via CPU Unit 2
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-15
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-4
Route
Path
7 CIP Message Communications
CPU Unit 1 CPU Unit 2 EtherNet/IP Unit 2 CPU Unit 3 EtherNet/IP Unit 3
IP address: Backplane Unit address Backplane


Question: 168.250.2 port #01 00 hex port #01

Answer:
Communica- Unit address
tions port 12 hex IP address:
(#02) Built-in


Answer:
EtherNet/IP port
Communications
port (#02)
Built-in EtherNet/IP EtherNet/IP port
EtherNet/IP port
port
a) CPU Unit 1 to CPU Unit 2
• Network type number: "#02" (Output the command via the EtherNet/IP port)
• Destination address: Specify the destination IP address
b) CPU Unit 2 to EtherNet/IP Unit 2
• Network type number: "#01" (Output the command via the internal backplane port)
• Destination address: "#12 hex" (Unit address of the EtherNet/IP Unit (Unit number: 2+10
hex =12 hex))
c) EtherNet/IP Unit 2 to EtherNet/IP Unit 3
• Network type number: "#02" (Output the command via the EtherNet/IP port)
• Destination address: Specify the destination IP address
d) EtherNet/IP Unit 3 to CPU Unit 3
• Network type number: "#01" (Output the command via the internal backplane port)
• Destination address: "#00" (Unit address of the CPU Unit)
Route path : 02\192.168.250.2\01\#12\02\192.168.257.3\01\#00
(1) (2) (3) (4)
7-2-5 Request Path (IOI)
A request path indicates an object of a device on the network.
A CIP communications instruction uses the request path to access an object of a device.
Overview of Request Path
In the CIP world, each device is modeled as a collection of objects. An Object abstractly represents
the specific configuration elements of a device.
External request
(example: read)
Object
Attributes
Service Data
Object
Data
Data
Object
Data
Processing
Object Instance
Device
7-16 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
In the CIP Common Specification, Object, Class, Instance, Attribute, and Service are defined as fol-
lows: (Source: CIP Common Specification)
Term Definition
Object An abstract representation of a particular component within a device.
Class A set of objects that all represent the same kind of system component.
Instance A specific and real (physical) occurrence of an object.
Attribute A description of an externally visible characteristic or feature of an object.
Service A request from an external object (e.g., to read data).
You use the Class ID Instance ID and Attribute ID to access an object.
You specify these three IDs to designate an object in a device.
When you make a request from an external device for a service, you must specify the Class ID In-
stance ID and Attribute ID. (The Instance ID and Attribute ID are not required for some services.)
.....
7 CIP Message Communications
Example: Reading the Name of a Device
(Identity Object Class ID = 1)
Class ID = 1
Instance ID = 1
Service Request Destination
Get_Attribute_ Class: 1 Instance ID = 1
Single Instance: 1
Attribute: 7 Attribute 1
Attribute 6
Response
Product Name Attribute 7
Class ID = 2
Attribute = 7
Device
These are called IOI (Internal Object Identifier) because they identify the Class ID, Instance ID, and
Attribute ID within the device.
Refer to 7-5 CIP Object Services on page 7-48 for the class ID, instance ID, attribute ID, and service
code for each object.
Providing the Structure Variables to Input Request Paths
For a CIP communications instruction, you prepare a variable to store the request path. In this varia-
ble, you specify the object to access with the user program.
A structure in which the Class ID, Instance ID, and Attribute ID are specified is provided for the data
type of a variable for a request path.
There are two types of structures: standard structure (_sREQUEST_PATH) and extension structure
(_sREQUEST_PATH_EX). When you use an extension structure, it is possible to specify the size ac-
cording to the size of values of the Class ID, Instance ID, and Attribute ID of the object that you ac-
cess. When you use a standard structure, the size is always set to 16 bits.
Version Information
A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are re-
quired to specify extension structure (_sREQUEST_PATH_EX).
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-17
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-5
Request
Path
(IOI)
7 CIP Message Communications
 When a Standard Structure Variable Is Used
Example: Using a standard structure variable to input values into RqPath (Request Path) for the
CIPSend instruction
Create variable A with a variable with
the standard structure (_sREQUEST_PATH).
RqPath data type
CIP communications instruction
Member Value
CIPSend
ClassID 2
(Class ID)
Variable A RqPath
(Request Path) InstanceID 3
(Instance ID)
isAttributeID
TRUE
(Attribute usage)
AttributeID
1
(Attribute ID)
1
Create a standard structure variable.
To use a standard structure variable to input values into RqPath (Request Path) for a CIP com-
munications instruction, first you need to create a standard structure user-defined variable.
When you create a variable in a variable table, select the pre-registered standard structure
(_sREQUEST_PATH) for a CIP communications instruction.
Variable table
Name Data type
A _sREQUEST_PATH
Select a standard structure for the data type of variable A.
2
Input a value for each standard structure variable member.
Input the following values into the communications parameters that were registered as mem-
bers of the standard structure variable.
MOVE
Variable name
EN
2 IN1 OUT1 A. ClasslD
MOVE
Member name of RqPath data type
EN
3 IN1 OUT1 A . InstancelD
MOVE
EN
TRUE IN1 OUT1 A . isAttributeID
MOVE
EN
1 IN1 OUT1 A . AttributelD
7-18 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
 When an Extension Structure Variable Is Used
Example: Using an extension structure variable to input values into RqPath (Request Path) for the
CIPSend instruction
Create variable A with a variable with
the extension structure (_sREQUEST_PATH_EX).
RqPath data type
CIP communications instruction
Member Value
CIPSend
ClassIDLogicalFormat _8BIT
(Class ID logical format)
Variable A RqPath
(Request Path) ClassID 3
(Class ID)
InstanceIDLogicalFormat _16BIT
(Instance ID logical format)
InstanceID 256
(Instance ID)
isAttributeID TRUE
(Attribute usage)
AttributeID _8BIT
(Attribute ID logical format)
AttributeID
1
(Attribute ID)
1
Create an extension structure variable.
To use an extension structure variable to input values into RqPath (Request Path) for a CIP
communications instruction, first you need to create an extension structure user-defined varia-
ble.
When you create a variable in a variable table, select the pre-registered extension structure
(_sREQUEST_PATH_EX) for a CIP communications instruction.
Variable table
Name Data type
A _sREQUEST_PATH_EX
Select an extension structure for the data type of variable A.
2
Input a value for each extension structure variable member.
Input the following values into the communications parameters that were registered as mem-
bers of the extension structure variable.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-19
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-5
Request
Path
(IOI)
7 CIP Message Communications
MOVE
Variable name
EN
_8BIT IN1 OUT1 A . ClassIDLogicalFormat
MOVE
Member name of RqPath data type
EN
3 IN1 OUT1 A. ClasslD
MOVE
EN
_16BIT IN1 OUT1 A . InstanceIDLogicalFormat
MOVE
EN
256 IN1 OUT1 A . InstancelD
MOVE
EN
TRUE IN1 OUT1 A . isAttributeID
MOVE
EN
_8BIT IN1 OUT1 A . AttributeIDLogicalFormat
MOVE
EN
1 IN1 OUT1 A . AttributelD
7-2-6 Service Data and Response Data
CIP communications instructions send and receive data that is stored in array variables.
Preparing Array Variables to Input and Output Service Data and Re-
sponse Data
This section describes the array variables for storing service data and response data that CIP commu-
nications instructions send and receive.
 Creating Array Variables
To input a value into the array variable of a CIP communications instruction, you must create a vari-
able with the same configuration as the array variable in advance.
Example: Creating a Variable to Input Data to the CIPSend Instruction Array Variables
7-20 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
CIP communications instruction
CIPSend
Variable A ServiceDat
(Command Data)
(1)
Variable B Size
(Number of Elements)
RespSize
(Response Variable D
Data Size)
ResServiceDat
(2) Variable C
(Response Data)
(1) Input the service data to send (2) Store received response data
The data to send is stored in array variable A. The data that is received is stored in variable C.
If only certain elements are specified in array var- The byte size of the data that was actually re-
iable A, specify the number of elements in varia- ceived is stored in variable D.
ble B.
Array variable: A Array variable: C[0..9]
[0] [0]
[1]
[1] [2]
[2] [3]
Number of elements: 2 Variable D [4]
[3] [5]
: 10
[6]
If the service data (ServiceDat) is [7]
Array[2] and number of elements [8]
(Size) = 2, Array[2] and Array[3] [9]
are sent.
Use the following procedure to create a variable in the variable table.
Specify the element first number, the element last number, and the data type.
Example: UINT Array
Variable table
Variable name Data type
A ARRAY[0..19] OF UINT
Specifies the data type.
 CIP Communications Instructions That Use Array Variables
Structure variable name
Instruction
Input variable In-out variable Output variable
CIPRead --- --- DstDat (Read Data)
CIPWrite SrcDat (Write Data) --- ---
CIPSend ServiceDat (Command Da- ResServiceDat (Response ---
ta) Data)
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-21
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-6
Service
Data
and
Response
Data
7 CIP Message Communications
7-2-7 Sample Programming for CIP Connectionless (UCMM) Message
Communications
This sample uses CIP UCMM messages to write a variable, read a variable, and send a message.
The Controllers are connected to an EtherNet/IP network. The IP address of the remote node is


Answer:
The following procedure is used.
1
The CIPUCMMWrite instruction is used to write the value of a variable at a remote node. The
variable name at the remote node is WritingDat and the contents of the WriteDat is written to it.
WritingDat must be defined as a global variable at the remote node and the Network Publish
attribute must be set.
2
The CIPUCMMRead instruction is used to read the value of a variable at a remote node. The
value of the variable OriginalDat at the other node is read and the read value is stored in the
ReadDat variable. OriginalDat must be defined as a global variable at the remote node and the
Network Publish attribute must be set.
3
The CIPUCMMSend instruction is used to send an explicit message to a remote node. The
contents of the message is to read identity information (product name). The class ID, instance
ID, attribute ID, and service code are as follows. The response data is stored in the RespDat
variable.
Item Value
Class ID 1
Instance ID 1
Attribute ID 7
Service Code 16#0E
IP address: 192.168.250.2
Built-in EtherNet/IP Port Built-in EtherNet/IP Port
Value of variable written. Variable name: WritingDat
WriteDat Global variable
Network Publish attribute
Value of variable read. Variable name: OriginalDat
ReadDat Global variable
Network Publish attribute
Message sent to read identity
information (product name).
RespDat
Response
7-22 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
LD
Variable Data type Initial value Comment
OperatingEnd BOOL False Processing
completed
Trigger BOOL False Execution con-
dition
Operating BOOL False Processing
WriteDat INT 1234 Write data
ReadDat INT 0 Read data
ReqPath _sRE- (ClassID:=0, InstanceID:=0, Request path
QUEST_PATH isAttributeID:=False, AttributeID:=0)
RespDat ARRAY[0..10] OF [11(16#0)] Response data
BYTE
Dummy BYTE 16#0 Dummy
RS_instance RS
CIPUCMMWrite_instance CIPUCMMWrite
CIPUCMMRead_instance CIPUCMMRead
CIPUCMMSend_instance CIPUCMMSend
Determine if instruction execution is completed.
CIPUCMMWrite_instance.Done CIPUCMMRead_instance.Done CIPUCMMSend_instance.Done OperatingEnd
CIPUCMMWrite_instance.Error
CIPUCMMRead_instance.Error
CIPUCMMSend_instance.Error
Accept trigger.
CIPUCMMWrite CIPUCMMRead CIPUCMMSend RS_instance
Trigger _instance.Busy _instance.Busy _instance.Busy Operating
RS
Set Q1
OperatingEnd Reset1
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-23
7-2
Client
Function
of
CIP
Message
Communications
7
tions 7-2-7
Sample
Programming
for
CIP
Connectionless
(UCMM)
Message
Communica-
7 CIP Message Communications
Execute instructions.
CIPUCMMWrite_instance
Operating
CIPUCMMWrite
Execute Done
‘02\192.168.250.2’ RoutePath Busy
UINT#20 TimeOut Error
‘WritingDat’ DstDat ErrorID
UINT#1 Size ErrorIDEx
WriteDat SrcDat
CIPUCMMRead_instance
CIPUCMMWrite_instance.Done CIPUCMMRead
Execute Done
‘02\192.168.250.2’ RoutePath Busy
UINT#20 TimeOut Error
‘OriginalDat’ SrcDat ErrorID
UINT#1 Size ErrorIDEx
DstDat
ReadDat ReadDat
RcvSize
CIPUCMMRead_instance.Done
@MOVE
EN ENO
UINT#1 In Out ReqPath.ClassID
@MOVE
EN ENO
UINT#1 In Out ReqPath.InstanceID
@MOVE
EN ENO
TRUE In Out ReqPath.isAttributeID
@MOVE
EN ENO
UINT#7 In Out ReqPath.AttributeID
CIPUCMMSend_instance
CIPUCMMSend
Execute Done
‘02\192.168.250.2’ RoutePath Busy
UINT#20 TimeOut Error
BYTE#16#0E ServiceCode ErrorID
ReqPath RqPath ErrorIDEx
Dummy ServiceDat RespSize
UINT#0 Size
RespServiceDat
RespDat RespDat
Processing after normal end
Inline ST
Operating CIPUCMMSend_instance.Done
1 // Processing after normal end
2 ;
Processing after error end.
Inline ST
Operating CIPUCMMWrite_instance.Error
1 // Processing after error end.
2 ;
CIPUCMMRead_instance.Error
CIPUCMMSend_instance.Error
7-24 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
ST
Internal
Variable Data type Initial value Comment
variables
Trigger BOOL False Execution condi-
tion
DoUCMMTrigger BOOL False Processing
Stage INT 0 Status change
WriteDat INT 1234 Write data
ReadDat INT 0 Read data
ReqPath _sRE- (ClassID:=0, InstanceID:=0, Request path
QUEST_PATH isAttributeID:=False, AttributeID:=0)
RespDat ARRAY[0..10] OF [11(16#0)] Response data
BYTE
Dummy BYTE 16#0 Dummy
CIPUCMMWrite_instance CIPUCMMWrite
CIPUCMMRead_instance CIPUCMMRead
CIPUCMMSend_instance CIPUCMMSend
External
Variable Data type Constant Comment
variable
_EIP_EtnOnlineSta*1 BOOL Online
*1. For an NX701 CPU Unit, NX502 CPU Unit, and NX102 CPU Unit, replace the variable with _EIP1_EtnOnlineSta (Port1
Online) or _EIP2_EtnOnlineSta (Port2 Online), depending on the built-in EtherNet/IP port which is used.
For an NX1P2 CPU Unit, replace the variable with _EIP1_EtnOnlineSta (Port1 Online).
// Start sequence when Trigger changes to TRUE
IF ((Trigger=TRUE) AND (DoUCMMTrigger=FALSE) AND (_EIP_EtnOnlineSta=TRU
E))
THEN
DoUCMMTrigger :=TRUE;
Stage :=INT#1;
CIPUCMMWrite_instance(
Execute :=FALSE, // Initialize instan
ce
SrcDat :=WriteDat); // Dummy
CIPUCMMRead_instance( // Initialize in
stance
Execute :=FALSE, // Dummy
DstDat :=ReadDat); // Dummy
CIPUCMMSend_instance(
Execute :=FALSE, // Initialize instan
ce
ServiceDat :=Dummy, // Dummy
Rqpath :=ReqPath, // Dummy
RespServiceDat :=RespDat); // Dummy
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-25
7-2
Client
Function
of
CIP
Message
Communications
7
tions 7-2-7
Sample
Programming
for
CIP
Connectionless
(UCMM)
Message
Communica-
7 CIP Message Communications
END_IF;
IF (DoUCMMTrigger=TRUE) THEN
CASE Stage OF
1 : // Request writi
ng value of variable
CIPUCMMWrite_instance(
Execute :=TRUE,
RoutePath :='02\192.168.250.2', // Route path
TimeOut :=UINT#20, // Timeout time
DstDat :='WritingDat', // Destination variable
name
Size :=UINT#1, // Number of elements to
write
SrcDat :=WriteDat); // Write data
IF (CIPUCMMWrite_instance.Done=TRUE) THEN
Stage :=INT#2; // Normal end
ELSIF (CIPUCMMWrite_instance.Error=TRUE) THEN
Stage :=INT#10; // Error end
END_IF;
2 : // Request readi
ng value of variable
CIPUCMMRead_instance(
Execute :=TRUE,
RoutePath :='02\192.168.250.2', // Route path
TimeOut :=UINT#20, // Timeout time
SrcDat :='OriginalDat', // Source variable name
Size :=UINT#1, // Number of elements to
read
DstDat :=ReadDat); // Read data
IF (CIPUCMMRead_instance.Done=TRUE) THEN
Stage :=INT#3; // Normal end
ELSIF (CIPUCMMRead_instance.Error=TRUE) THEN
Stage :=INT#40; // Error end
END_IF;
3 : // Send message
ReqPath.ClassID :=UINT#01;
ReqPath.InstanceID :=UINT#01;
ReqPath.isAttributeID:=TRUE;
ReqPath.AttributeID :=UINT#07;
CIPUCMMSend_instance(
Execute :=TRUE,
RoutePath :='02\192.168.250.2', // Route path
TimeOut :=UINT#20, // Timeout time
7-26 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
ServiceCode :=BYTE#16#0E, // Service code
RqPath :=ReqPath, // Request path
ServiceDat :=Dummy, // Service data
Size :=UINT#0, // Number of elements
RespServiceDat :=RespDat); // Response data
IF (CIPUCMMSend_instance.Done=TRUE) THEN
Stage :=INT#0; // Normal end
ELSIF (CIPUCMMSend_instance.Error=TRUE) THEN
Stage :=INT#30; // Error end
END_IF;
0: // Processing af
ter normal end
DoUCMMTrigger :=FALSE;
Trigger :=FALSE;
ELSE // Processing af
ter error end
DoUCMMTrigger :=FALSE;
Trigger :=FALSE;
END_CASE;
END_IF;
7-2-8 Sample Programming for CIP Connection (Class 3) Message
Communications
This sample uses CIP class 3 messages to write a variable, read a variable, and send a message.
The Controllers are connected to an EtherNet/IP network. The IP address of the remote node is


Answer:
The following procedure is used.
1
The CIPOpen is used to open a class 3 connection (Large_Forward_Open). The timeout time
is 2 s.
2
The CIPWrite instruction is used to write the value of a variable at a remote node. The variable
name at the remote node is WritingDat and the contents of the WriteDat is written to it.
WritingDat must be defined as a global variable at the remote node and the Network Publish
attribute must be set.
3
The CIPRead instruction is used to read the value of a variable at a remote node. The value of
the variable OriginalDat at the other node is read and the read value is stored in the ReadDat
variable. OriginalDat must be defined as a global variable at the remote node and the Network
Publish attribute must be set.
4
The CIPSend instruction is used to send an explicit message to a remote node. The contents
of the message is to read identity information (product name). The class ID, instance ID, attrib-
ute ID, and service code are as follows. The response data is stored in the RespDat variable.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-27
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-8
Sample
Programming
for
CIP
Connection
(Class
3)
Message
Communications
7 CIP Message Communications
Item Value
Class ID 1
Instance ID 1
Attribute ID 7
Service Code 16#0E
5
The CIPClose instruction is used to close the class 3 connection.
IP address: 192.168.250.2
Built-in EtherNet/IP Port Built-in EtherNet/IP Port
Value of variable written. Variable name: WritingDat
WriteDat Global variable
Network Publish attribute
Value of variable read. Variable name: OriginalDat
ReadDat Global variable
Network Publish attribute
Message sent to read identity
information (product name).
RespDat
Response
LD
Variable Data type Initial value Comment
OperatingEnd BOOL False Processing com-
pleted
Trigger BOOL False Execution condi-
tion
Operating BOOL False Processing
WriteDat INT 1234 Write data
ReadDat INT 0 Read data
ReqPath _sRE- (ClassID:=0, InstanceID:=0, isAttribu- Request path
QUEST_PATH teID:=False, AttributeID:=0)
RespDat ARRAY[0..10] OF [11(16#0)] Response data
BYTE
Dummy BYTE 16#0 Dummy
RS_instance RS
CIPOpen_instance CIPOpen
CIPWrite_instance CIPWrite
CIPRead_instance CIPRead
CIPSend_instance CIPSend
CIPClose_instance CIPClose
7-28 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Determine if instruction execution is completed.
CIPWrite_instance.Done CIPSend_instance.Done OperatingEnd
CIPOpen_instance.Done CIPRead_instance.Done CIPClose_instance.Done
CIPOpen_instance.Error
CIPWrite_instance.Error
CIPRead_instance.Error
CIPSend_instance.Error
CIPClose_instance.Error
Accept trigger.
CIPOpen_ CIPWrite_ CIPRead_ CIPSend_ CIPClose_ RS_instance
Trigger instance.Busy instance.Busy instance.Busy instance.Busy instance.Busy RS Operating
Set Q1
OperatingEnd Reset1
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-29
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-8
Sample
Programming
for
CIP
Connection
(Class
3)
Message
Communications
7 CIP Message Communications
Execute instructions.
CIPOpen_instance
Operating
CIPOpen
Execute Done
‘02\192.168.250.2’ RoutePath Busy
UINT#20 TimeOut Error
ErrorID
ErrorIDEx
Handle
CIPWrite_instance
CIPOpen_instance.Done CIPWrite
Execute Done
CIPOpen_instance.Handle Handle Busy
‘WritingDat’ DstDat Error
UINT#1 Size ErrorID
WriteDat SrcDat ErrorIDEx
CIPRead_instance
CIPWrite_instance.Done CIPRead
Execute Done
CIPOpen_instance.Handle Handle Busy
‘OriginalDat’ SrcDat Error
UINT#1 Size ErrorID
DstDat ErrorIDEx
ReadDat ReadDat
RcvSize
CIPRead_instance.Done
@MOVE
EN ENO
UINT#1 In Out ReqPath.ClassID
@MOVE
EN ENO
UINT#1 In Out ReqPath.InstanceID
@MOVE
EN ENO
TRUE In Out ReqPath.isAttributeID
@MOVE
EN ENO
UINT#7 In Out ReqPath.AttributeID
CIPSend_instance
CIPSend
Execute Done
CIPOpen_instance.Handle Handle Busy
BYTE#16#0E ServiceCode ErrorID
ReqPath RqPath ErrorIDEx
Dummy ServiceDat RespSize
UINT#0 Size RespSize
RespServiceDat
RespDat RespDat
CIPClose_instance
CIPSend_instance.Done CIPClose
Execute Done
CIPOpen_instance.Handle Handle Busy
Error
ErrorID
ErrorIDEx
7-30 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Processing after normal end
Inline ST
Operating CIPClose_instance.Done
1 // Processing after normal end
2 ;
Processing after error end.
Inline ST
Operating CIPOpen_instance.Error
1 // Processing after error end.
2 ;
CIPWrite_instance.Error
CIPRead_instance.Error
CIPSend_instance.Error
CIPClose_instance.Error
ST
Internal
varia- Variable Data type Initial value Comment
bles
Trigger BOOL False Execution con-
dition
DoCIPTrigger BOOL False Processing
Stage INT 0 Status change
WriteDat INT 1234 Write data
ReadDat INT 0 Read data
ReqPath _sRE- (ClassID:=0, InstanceID:=0, Request path
QUEST_PATH isAttributeID:=False, Attribu-
teID:=0)
RespDat ARRAY[0..10] [11(16#0)] Response data
OF BYTE
Dummy BYTE 16#0 Dummy
CIPOpen_instance CIPOpen
CIPWrite_instance CIPWrite
CIPRead_instance CIPRead
CIPSend_instance CIPSend
CIPClose_instance CIPClose
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-31
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-8
Sample
Programming
for
CIP
Connection
(Class
3)
Message
Communications
7 CIP Message Communications
External
Variable Data type Constant Comment
variable
_EIP_EtnOnlineSta*1 BOOL Online
*1. For an NX701 CPU Unit, NX502 CPU Unit, and NX102 CPU Unit, replace the variable with _EIP1_EtnOnli-
neSta (Port1 Online) or _EIP2_EtnOnlineSta (Port2 Online), depending on the built-in EtherNet/IP port
which is used.
For an NX1P2 CPU Unit, replace the variable with _EIP1_EtnOnlineSta (Port1 Online).
// Start sequence when Trigger changes to TRUE
IF ((Trigger=TRUE) AND (DoCIPTrigger=FALSE) AND (_EIP_EtnOnlineSta=TRUE))THEN
DoCIPTrigger :=TRUE;
Stage :=INT#1;
CIPOpen_instance(Execute:=FALSE); // Initialize instance
CIPWrite_instance(
Execute :=FALSE, // Initialize instance
SrcDat :=WriteDat); // Dummy
CIPRead_instance( // Initialize instance
Execute :=FALSE, // Dummy
DstDat :=ReadDat); // Dummy
CIPSend_instance(
Execute :=FALSE, // Initialize instance
ServiceDat := Dummy, // Dummy
RespServiceDat :=RespDat); // Dummy
CIPClose_instance(Execute:=FALSE); // Initialize instance
END_IF;
IF (DoCIPTrigger=TRUE) THEN
CASE Stage OF
1 : // Open CIP Class 3 Connection (
Large_Forward_Open)
CIPOpen_instance(
Execute :=TRUE,
TimeOut :=UINT#20, // Timeout time: 2.0 s
RoutePath :='02\192.168.250.2'); // Route path
IF (CIPOpen_instance.Done=TRUE) THEN
Stage :=INT#2; // Normal end
ELSIF (CIPOpen_instance.Error=TRUE) THEN
Stage :=INT#10; // Error end
END_IF;
2 : // Request writing value
of variable
CIPWrite_instance(
Execute :=TRUE,
Handle :=CIPOpen_instance.Handle, // Handle
DstDat :='WritingDat', // Destination variable
7-32 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
name
Size :=UINT#1, // Number of elements to
write
SrcDat :=WriteDat); // Write data
IF (CIPWrite_instance.Done=TRUE) THEN
Stage :=INT#3; // Normal end
ELSIF (CIPWrite_instance.Error=TRUE) THEN
Stage :=INT#20; // Error end
END_IF;
3 : // Request reading value
of variable
CIPRead_instance(
Execute :=TRUE,
Handle :=CIPOpen_instance.Handle, // Handle
SrcDat :='OriginalDat', // Source variable name
Size :=UINT#1, // Number of elements to
read
DstDat :=ReadDat); // Read data
IF (CIPRead_instance.Done=TRUE) THEN
Stage :=INT#4; // Normal end
ELSIF (CIPRead_instance.Error=TRUE) THEN
Stage :=INT#30; // Error end
END_IF;
4 : // Send message
ReqPath.ClassID :=UINT#01;
ReqPath.InstanceID :=UINT#01;
ReqPath.isAttributeID:=TRUE;
ReqPath.AttributeID :=UINT#07;
CIPSend_instance(
Execute :=TRUE,
Handle :=CIPOpen_instance.Handle, // Handle
ServiceCode :=BYTE#16#0E, // Service code
RqPath :=ReqPath, // Request path
ServiceDat :=Dummy, // Service data
Size :=UINT#0, // Number of elements
RespServiceDat :=RespDat); // Response data
IF (CIPSend_instance.Done=TRUE) THEN
Stage :=INT#5; // Normal end
ELSIF (CIPSend_instance.Error=TRUE) THEN
Stage :=INT#40; // Error end
END_IF;
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-33
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-8
Sample
Programming
for
CIP
Connection
(Class
3)
Message
Communications
7 CIP Message Communications
5 : // Request closing CIP c
lass 3 connection
CIPClose_instance(
Execute :=TRUE,
Handle :=CIPOpen_instance.Handle); // Handle
IF (CIPClose_instance.Done=TRUE) THEN
Stage :=INT#0;
ELSIF (CIPClose_instance.Error=TRUE) THEN
Stage :=INT#50;
END_IF;
0: // Processing after norm
al end
DoCIPTrigger :=FALSE;
Trigger :=FALSE;
ELSE // Processing after erro
r end
DoCIPTrigger :=FALSE;
Trigger :=FALSE;
END_CASE;
END_IF;
7-2-9 Operation Timing
Output Variable Operation and Timing
You can monitor the values of the output variables to determine the status throughout instruction exe-
cution.
The following timing chart shows the operation of the output variables.
(3) (4) (5) (8)
Execute
(1)
Busy
(Executing)
Changes to FALSE
because Execute
changes to FALSE.
Done Changes to FALSE
because Execute
changes to FALSE.
Error
(6)
(2) (7)
ErrorID 0x0000 0x1234
7-34 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications


Question: After the results of instruction execution are stored in the output variables, Done changes to TRUE

Answer: and Busy changes to FALSE.


Question: If an error occurs, several retries are attempted internally. The error code in ErrorID is not updated

Answer: during the retries.


Question: When a communications error occurs, Error changes to TRUE and the value of ErrorID is stored.

Answer: Also, Busy and Done change to FALSE.


Question: When Execute changes to FALSE, Error changes to FALSE.

Answer:
Precautions for Correct Use
If Execute changes back to FALSE before Done changes to TRUE, Done stays TRUE for only
one task period. (Example 1)
If you want to see if Done is TRUE at any time, make sure to keep Execute TRUE until you
confirm that Done is TRUE.
If Execute is TRUE until Done changes to TRUE, Done stays TRUE until Execute changes to
FALSE. (Example 2)
Example 1 Example 2
Execute Execute When Execute
Changes to changes to
FALSE in next Busy FALSE, Done
Busy task period. (Executing) returns to FALSE.
(Executing)
Done Done
7-2-10 Response Codes
This section describes the response codes stored in the ErrorIDEx output variable if an error occurs
during execution of a CIP message communications instruction.
General Status Codes
As response codes, general codes are stored in the ErrorIDEx output variable (DWORD data) after
execution of a CIP communications instruction is completed.
If an additional code is added, the additional code is also stored.
General status code (1 byte)
31 24 23 16 15 0
ErrorIDEx
Additional code (1 word)
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-35
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-10
Response
Codes
7 CIP Message Communications
General
status Status name Description of status
code (hex)
00 Success Service was successfully performed by the object specified.
01 Connection failure A connection related to service failed along the connection path.
02 Resource unavailable Resources needed for the object to perform the requested service
were unavailable.
03 Invalid parameter value See Status Code 20 hex.
04 Path segment error The path segment identifier or the segment syntax was not under-
stood by the processing node. Path processing stops when a path
segment error occurs.
05 Path destination unknown The path is referencing an object class, instance, or structure ele-
ment that is not known or is not contained in the processing node.
Path processing stops when a Path Destination Unknown Error oc-
curs.
06 Partial transfer Only part of the expected data was transferred.
07 Connection lost The message connection was lost.
08 Service not supported The requested service was not supported or was not defined for this
object class/instance.
09 Invalid attribute value Invalid attribute data was detected.
0A Attribute list error An attribute in the Get_Attribute_List or Set_Attribute_List response
has a non-zero status.
0B Already in requested The object is already in the mode/state being requested by the serv-
mode/state ice.
0C Object state conflict The object cannot perform the requested service in its current mode/
state.
0D Object already exists The requested instance of object to be created already exists.
0E Attribute not settable A request to modify a non-modifiable attribute was received.
0F Privilege violation A permission/privilege check failed.
10 Device state conflict The device's current mode/state prohibits the execution of the re-
quested service.
11 Reply data too large The data to be transmitted in the response buffer is larger than the
allocated response buffer.
12 Fragmentation of a primi- The service specified an operation that is going to fragment a primi-
tive value tive data value, i.e. half a REAL data type.
13 Not enough data The requested service did not supply enough data to perform the
specified operation.
14 Attribute not supported The attribute specified in the request is not supported.
15 Too much data The service supplied more data than was expected.
16 Object does not exist An object that does not exist was specified for the requested serv-
ice.
17 Service fragmentation se- The fragmentation sequence for this service is not currently active
quence not in progress for this data.
18 No stored attribute data The attribute data of this object was not saved prior to the requested
service.
19 Store operation failure The attribute data of this object was not saved due to a failure dur-
ing the attempt.
1A Routing failure (request The service request packet was too large for transmission on a net-
packet too large) work in the path to the destination. The routing device was forced to
abort the service.
7-36 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
General
status Status name Description of status
code (hex)
1B Routing failure (response The service response packet was too large for transmission on a
packet too large) network in the path from the destination. The routing device was
forced to abort the service.
1C Missing attribute list entry The service did not supply an attribute in a list of attributes that was
data needed by the service to perform the requested behavior.
1D Invalid attribute value list The service is returning the list of attributes supplied with status in-
formation for those attributes that were invalid.
1E Embedded service error An embedded service resulted in an error.
1F Vendor specific error A vendor-specific error occurred. The Additional Code Field of the
error response defines the error. This is a general error code that is
used only for errors that do not correspond to any of the error codes
in this table and are not in an object class definition.
20 Invalid parameter A parameter for the requested service is invalid. This code is used
when a parameter does not meet the requirements of the specifica-
tion and/or the requirements defined in an application object specifi-
cation.
21 Write-once value or medi- An attempt was made to write to a write-once medium (e.g. WORM
um already written drive or PROM) that was previously written or cannot be changed.
22 Invalid Reply Received An invalid reply was received. (For example, the reply service code
does not match the request service code. Or, the reply message is
shorter than the minimum expected reply size.) This status code is
used for other causes of invalid replies.
23-24 Reserved by CIP for future extensions.
25 Key Failure in path The key segment that was included as the first segment in the path
does not match the destination module. The object specific status
must indicate which part of the key check failed.
26 Path Size Invalid The size of the path that was sent with the service request is either
too large or too small for the request to be routed to an object.
27 Unexpected attribute in list An attempt was made to set an attribute that is not able to be set at
this time.
28 Invalid Member ID The member ID specified in the request does not exist in the speci-
fied class, instance, and attribute.
29 Member not settable A request to modify a non-modifiable member was received.
2A Group 2 only server gen- This error code is reported only by group 2 only servers with 4K or
eral failure less of code space and only in place of Service not supported,
Attribute not supported, or Attribute not settable.
2B-CF Reserved by CIP for future extensions.
D0-FF Reserved for Object Class This range of error codes is to be used to indicate object class-spe-
and service errors cific errors. This code range is used only when none of the error co-
des in this table accurately reflect the error that occurred. The addi-
tional code field is used to describe the general error code in more
detail.
 Examples of Additional Status When General Status Is 01 hex (Status of
Connection Manager Object)
General Additional
Status Status Description
(hex) (hex)
01 0100 Connection in use or duplicate forward open.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-37
7-2
Client
Function
of
CIP
Message
Communications
7
7-2-10
Response
Codes
7 CIP Message Communications
General Additional
Status Status Description
(hex) (hex)
01 0103 Transport class and trigger combination not supported.
01 0106 Ownership conflict.
01 0107 Connection not found at target application.
01 0108 Invalid connection type. There is a problem with either the connection type or
priority of the connection.
01 0109 Invalid connection size.
01 0110 Device not configured.
01 0111 RPI not supported. May also indicate problem with connection time-out multi-
plier, or production inhibit time.
01 0113 Connection Manager cannot support any more connections.
01 0114 Either the vendor ID or the product code in the key segment does not match
the device.
01 0115 Device type in the key segment does not match the device.
01 0116 Major Revision or Minor Revision in the key segment.
01 0117 Invalid connection point.
01 0118 Invalid configuration format.
01 0119 Connection request failed because there is no controlling connection currently
open.
01 011A Target application cannot support any more connections.
01 011B RPI is smaller than the production inhibit time.
01 0127 Invalid originator to target network connection size
01 0128 Invalid target to originator network connection size
01 0203 Connection cannot be closed because the connection has timed out.
01 0204 Unconnected_Send service timed out while waiting for a response.
01 0205 Parameter error in Unconnected_Send service.
01 0206 Message too large for unconnected message service.
01 0207 Unconnected acknowledgment without reply.
01 0301 No buffer memory available.
01 0302 Network bandwidth not available for data.
01 0303 No tag filters available.
01 0304 Not configured to send real-time data.
01 0311 Port that was specified in port segment is not available.
01 0312 Link address that was specified in port segment is not available.
01 0315 Invalid segment type or segment value in path.
01 0316 Path and connection were not equal when closing the connection.
01 0317 The segment is not present. Or, the encoded value in the network segment is
invalid.
01 0318 Link address to self is invalid.
01 0319 Resources on secondary are unavailable.
01 031A Connection is already established.
01 031B Direct connection is already established.
01 031C Others
01 031D Redundant connection mismatch.
01 031E There are no more reception resources available on the sending module.
01 031F No connection resources exist for the target path.
01 0320-07FF Vendor specific.
7-38 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
7-3 Server Function of CIP Message
Communications
After the NJ/NX-series Controller receives the CIP messages from external devices, this function exe-
cutes services for a specified self-contained object in the CPU Unit.
This is called the server function of CIP message communications.
This section provides information on CIP messages structure along with information about how to use
CIP messages in a program that runs on a computer or by other means and uses the server function
of CIP message communications to perform the following: -Writing CIP objects and the values of varia-
bles to the NJ/NX-series Controller, -Reading CIP objects and the values of variables from the NJ/NX-
series Controller.
To read and write CIP objects or the values of variables between NJ/NX-series Controllers, use the
CIP communications instructions.
Refer to 7-2 Client Function of CIP Message Communications on page 7-4 for information on how to
use CIP communications instructions for CIP message communications.
Computer
Request
The variable to access
is specified in the
request path of the
CIP object or the Response
explicit message
to read or write data. The writing results of the
specified CIP object or
variable, or the value that was
NJ/NX-series Controller read from the specified CIP NJ/NX-series Controller
object or variable are stored
in the response.
Variable Variable
You can read and write variables with
CIP communications instructions.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-39
7-3
Server
Function
of
CIP
Message
Communications
7
7-3-1
CIP
Message
Structure
for
Accessing
CIP
Objects
7 CIP Message Communications
Precautions for Correct Use
• To allow the Controller to receive CIP messages, select the Use Option for the CIP message
server of the built-in EtherNet/IP port. If the Do not use Option for the CIP message server is
selected, the Controller cannot receive CIP messages. For the details on the settings, refer to
CIP Message Server on page 4-21.
• If the Use Option is selected for Packet Filter of the built-in EtherNet/IP port, make sure to
permit packets to be used for CIP messages. If they are not permitted, the CIP message can-
not be received. For the details on the settings, refer to Packet Filter on page 4-8.
• If the Do not use Option for the CIP message server is selected, EtherNet/IP communica-
tions cannot be used. This causes the following restrictions on the functionality of connected
devices, tools, and Controllers.
Category Restrictions
Connect- • The programmable terminal NS-series cannot be connected.
ed device
Tools • Sysmac Studio cannot go online through Remote connection via USB.
• Tag data link setting using Sysmac Studio is not possible.
• CX-Compolet and SYSMAC Gateway cannot be connected.
• CNC Operator cannot be connected.
• Network Configurator cannot be connected. Or, devices cannot be displayed.
• CX-Configurator FDT (communication DTM OMRON EtherNet/IP) cannot be connect-
ed.
• Sysmac Conrtoller Log Upload Tool cannot be connected to the Controller through
Remote connection via USB.
Controller • The tag data link function cannot be used.
features • CIP Safety communications cannot be used with a configuration in which an NX-SL5£
££ is connected to the CPU Unit.
• The server function of CIP messages (UCMM, Class 3) in the built-in EtherNet/IP port
cannot be used.
Additional Information
• Selecting the Do not use Option for the CIP message server closes the TCP/UDP ports used
for EtherNet/IP communications. This improves security of communications over the network.
• Even if the Do not use Option for the CIP message server is selected, the TCP/UDP mes-
sage services can be used. You can also use the client function (CIP communications instruc-
tions) of CIP message communications.
Version Information
The CIP message server settings can be used with the following unit versions of the CPU Unit.
• NJ-series, NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
• NX502 CPU Unit: Version 1.60 or later
7-3-1 CIP Message Structure for Accessing CIP Objects
This section shows how to specify messages to access CIP objects.
The CIP objects to be accessed are expressed by connecting the segments
defined in the CIP Common Specifications in the request path field in a CIP explicit message.
7-40 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Example: Performing the Reset service (0x05) to the Instance (01 hex) of the Identity object (class: 01
hex)
CIP Explicit Message (Request)
Request Path Request
Service Service
Request
Code Path Length [1] [2] Data
(20 01) (24 01)
(0x05) (num of
(02)
elem)
Logical Segment Logical Segment
(Class ID) (Instance ID)
Specify the service Specify the Class ID and Specify the Request Data
code to perform. (*1) Instance ID to access. according to the service.
*1. Refer to 7-5 CIP Object Services on page 7-48 for information about the service codes.
7-3-2 CIP Message Structure for Accessing Variables
This section shows how to specify messages to access variables.
The variables to access are given by connecting the segments that are defined in the CIP Common
specifications so that explicit message can be set in the request path field.
The following elements are combined to make the specification.
Specifying the variable to access: The elements are stored in the CIP segments and then joined to
make the message.
Example: Reading the Present Value of One Member of the VarAA.MemB[1.2] Structure Variable
Example for Using the CIP Read Data Service for a Variable Object
CIP Explicit Message for a Request
Request Path Request
Service Service
Request
Code Path Length “VarAA” “MemB” [1] [2] Data
(91 05 56 61 72 41 41 00) (91 04 4D 65 6D 42) (28 01) (28 02)
(4C hex) (num of
(09)
elem)
ANSI Extended Symbol Segment Logical Segment
(Member ID)
Specify the service code to perform Specify the variable name and Specify the data format to read
reading and writing variables. (*1) range to access. (*2) and write. (*3)
*1. Refer to 7-6 Read and Write Services for Variables on page 7-85 for information about the service codes.
*2. Refer to 7-4-5 Specifying Variable Names in Request Paths on page 7-44 for information about how to speci-
fy variables names.
*3. Refer to 7-7 Variable Data Types on page 7-89 for details about how to specify data formats.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-41
7-3
Server
Function
of
CIP
Message
Communications
7
7-3-2
CIP
Message
Structure
for
Accessing
Variables
7 CIP Message Communications
7-4 Specifying Request Path
The CIP object, variable name, structure member name, and array index are specified in the request
path.
In CIP, the EPATH data type is used for the request path.
With this method, the request path is divided into segments and a value is assigned to each segment.
The request path notation shows the path to the final destination when the data segments are joined
together.
Each segment includes the segment type information and the segment data.
Segment 1 Segment 2 Segment 3 Segment 4
The first byte gives the interpretation method for the segment. It consists of two parts; a 3-bit segment
type and a 5-bit segment format.
Segment Type Segment Format
7 6 5 4 3 2 1 0
The segment type specifications are defined as follows in the CIP specifications.
Segment Type
Meaning
7 6 5
0 0 0 Port Segment
0 0 1 Logical Segment
0 1 0 Network Segment
0 1 1 Symbolic Segment
1 0 0 Data Segment
1 0 1 Data Type
1 1 0 Data Type
1 1 1 Reserved
The specifications for the segment format are different for each segment type. Use the segment format
to request a service from a particular object of a particular device.
Logical segments and data segments, which are needed to specify variables in CIP message commu-
nications, are described below.
7-4-1 Examples of CIP Object Specifications
Logical Segments are joined to form the request path that specifies the object to access.
Logical Segment Logical Segment Logical Segment
(Class ID) (Instance ID) (Attribute ID)
Specify the Class ID. Specify the Instance ID. Specify the Attribute ID.
7-42 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
7-4-2 Examples of Variable Specifications
Segments are joined to form the request path that specifies the variable to access.
Data Segment Logical Segment
(ANSI Extended Symbol Segment) (Member ID)
Specify the variable name and Specify the array index.
the member name.
7-4-3 Logical Segment
A logical segment is used to give the range of the CIP Object or variable (array) in the request path.
Segment Format Bits
Segment Type Logical Type Logical Format
7 6 5 4 3 2 1 0
0 0 1
Logical Type
Meaning
4 3 2
0 0 0 Class ID
0 0 1 Instance ID
0 1 0 Member ID
0 1 1 Connection Point
1 0 0 Attribute ID
1 0 1 Special (Do not use the logical addressing definition for the Logical Format.)
1 1 0 Service ID (Do not use the logical addressing definition for the Logical Format.)
1 1 1 Reserved
Logical
Format Meaning
1 0
0 0 8 bit logical address
0 1 16 bit logical address
1 0 32 bit logical address
1 1 Reserved
An 8-bit or 16-bit logical address can be used for the class ID and attribute ID.
An 8-bit,16-bit, or 32-bit logical address can be used for the instance ID.
7-4-4 Data Segment
A data segment is used to give the specified variable name in the request path.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-43
7-4
Specifying
Request
Path
7
7-4-2
Examples
of
Variable
Specifications
7 CIP Message Communications
SSSSSSeeeeeeggggggmmmmmmeeeeeennnnnntttttt TTTTTTyyyyyyppppppeeeeee SSSSSSSSSSSSSeeeeeeeeeeeeegggggggggggggmmmmmmmmmmmmmeeeeeeeeeeeeennnnnnnnnnnnnttttttttttttt SSSSSSSSSSSSSuuuuuuuuuuuuubbbbbbbbbbbbb-------------TTTTTTTTTTTTTyyyyyyyyyyyyypppppppppppppeeeeeeeeeeeee DDDDDDDDDDDaaaaaaaaaaatttttttttttaaaaaaaaaaa SSSSSSSSSSSeeeeeeeeeeegggggggggggmmmmmmmmmmmeeeeeeeeeeennnnnnnnnnnttttttttttt DDDDDDDDDDDaaaaaaaaaaatttttttttttaaaaaaaaaaa
77 66 55 44 33 22 111 000
111 000 000 VVVVVVVVVVVVVVVaaaaaaaaaaaaaaarrrrrrrrrrrrrrriiiiiiiiiiiiiiiaaaaaaaaaaaaaaabbbbbbbbbbbbbbbllllllllllllllleeeeeeeeeeeeeee llllllllllllllleeeeeeeeeeeeeeennnnnnnnnnnnnnngggggggggggggggttttttttttttttthhhhhhhhhhhhhhh
Segment Sub-Type
Meaning
4 3 2 1 0
0 0 0 0 0 Simple Data Segment
1 0 0 0 1 ANSI Extended Symbol Segment
A data segment is mainly used for an ANSI extended symbol segment.
This segment sub-type is used to read and write the values of variables.
ANSI Extended Symbol Segment
Segment Type Segment Sub Type Symbol Size
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
1 0 0 1 0 0 0 1
Symbol (ANSI) Symbol (ANSI)
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
7-4-5 Specifying Variable Names in Request Paths
Variable Names
A variable name is specified as a symbolic segment (ANSI extended symbol segment).
Variable Name Specification Format
BYTE 91 hex ANSI Extended Symbol Segment
BYTE Length in BYTE Length of variable name in bytes
Array of : Variable name encoded in UTF-8
octet Variable_name
:
Octet (pad) 00 hex. One byte is padded if the variable
name length is an odd number of bytes.
Variable Names
Variable names are encoded in UTF-8.
7-44 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Structure Member Names
Structure member names are specified in the same way as variable names.
Store UTF-8 character codes in the ANSI extended symbol segment.
Array Indices
Specify the array index in a logical segment that is set as a member ID.
You can specify an array index ([x]) in a variable name.
(Specification Method 1: 8-bit Index)
BYTE 28 hex Logical Segment (Member ID)
USINT Index Array index from 0 to 255
(Specification Method 2: 16-bit Index)
BYTE 29 hex Logical Segment (Member ID)
octet 00 hex Pad
UINT Index (L) Array index from 0 to 65,535
(H)
Range Specifications with the Num of Element Field
There is a Num of Element field in the request data for the variable read and variable write services.
You can use these services to access the specified range of an array with the following specifications.
• Specify the first element in the range of elements to access in the array variable as the variable to
read or write.
• Specify the number of elements to access in the Num of Element field.
Specification Examples
This example shows how to specify VarAA.MemB[1.2] for the following structure variable.
struct
{
UINT MemA;
BOOL MemB[10][10];
} VarAA;
Variable Name Specification Format
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-45
7-4
Specifying
Request
Path
7
7-4-5
Specifying
Variable
Names
in
Request
Paths
7 CIP Message Communications
BYTE 91 hex ANSI Extended Symbol Segment
BYTE 05 hex Length of variable name in bytes
Array of 'V' Variable name
octet 'a'
'r'
'A'
'A'
Octet 00 hex Pad
BYTE 91 hex ANSI Extended Symbol Segment
BYTE 04 hex Length of variable name in bytes
Array of 'M' Variable name
octet 'e'
'm'
'B'
BYTE 28 hex Logical Segment (Member ID)
USINT 01 hex Array index for the first element
BYTE 28 hex Logical Segment (Member ID)
USINT 02 hex Array index for the second element
The variable name that is specified in the symbolic segment (ANSI extended symbol segment) must
be converted to a text string to pass it to the communications thread. The following conversion rules
apply.
Specification Example for Structure Members and Array Elements
0x91 0x05“VarAA”0x00 0x91 0x04“MemB” 0x28 0x01 0x28 0x02
VVAarRA:A//V.maerAmAB.m[1e.2m] b er[1][2]
This example shows how to specify VarAA[1].MemB[1.2] for the following structure variable.
struct
{
UINT MemA;
BOOL MemB[10][10];
} VarAA[3]
Variable Name Specification Format
7-46 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
BYTE 91 hex ANSI Extended Symbol Segment
BYTE 05 hex Length of variable name in bytes
Array of 'V' Variable name
octet 'a'
'r'
'A'
'A'
Octet 00 hex Pad
BYTE 28 hex Logical Segment (Member ID)
USINT 01 hex Array index
BYTE 91 hex ANSI Extended Symbol Segment
BYTE 04 hex Length of variable name in bytes
Array of 'M' Variable name
octet 'e'
'm'
'B'
BYTE 28 hex Logical Segment (Member ID)
USINT 01 hex Array index for the first element
BYTE 28 hex Logical Segment (Member ID)
USINT 02 hex Array index for the second element
Specification Example for Structure Array
0x91 0x05 “VarAA” 0x00 0x28 0x01 0x91 0x04 “MemB” 0x28 0x01 0x28 0x02
VVaArRA:A//[V1a].rmAAem.mBe[m1.b2e] r[1][2]
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-47
7-4
Specifying
Request
Path
7
7-4-5
Specifying
Variable
Names
in
Request
Paths
7 CIP Message Communications
7-5 CIP Object Services
This section shows services that specify the CIP object in the Request Path and access the CIP mes-
sage server function of the NJ/NX-series Controllers.
7-5-1 CIP Objects Sent to the Built-in EtherNet/IP Port
The following CIP objects can be sent to an EtherNet/IP port.
Object name Function Reference
Identity object • Reads ID information from the CPU Unit. page 7-48
• Resets the built-in EtherNet/IP port.
NX Configuration object • Reads and Writes NX object. page 7-53
• Restarts the NX Unit and initializes the Unit opera-
tion settings.
• Saves the parameters of the NX Unit and switches
the write mode.
• Obtains the current errors of the Controller and NX
Unit, and obtains and clears an event log.
• Obtains the user-defined errors of the Controller.
TCP/IP Interface object • Writes and reads TCP/IP settings. page 7-74
Ethernet Link object • Reads Ethernet settings. page 7-77
• Reads Ethernet status.
Controller object • Gets the Controller status. page 7-83
• Changes the operating mode of the Controller.
7-5-2 Identity Object (Class ID: 01 hex)
This object reads the ID information of the CPU Unit and resets the built-in EtherNet/IP port.
When using an NX701 CPU Unit, NX502 CPU Unit, or NX102 CPU Unit, use the route path to specify
the port number (1 or 2) of the built-in EtherNet/IP port to access.
Service Codes
Specify the service to execute with the service code.
Supported serv-
Service ices
Parameter name Description
code Instan-
Classes
ces
01 hex Get_Attribute_All Reads the values of the attributes. Support- Support-
ed ed
0E hex Get_Attribute_Single Reads the value of the specified attribute. Support- Support-
ed ed
7-48 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Supported serv-
Service ices
Parameter name Description
code Instan-
Classes
ces
05 hex Reset Resets the built-in EtherNet/IP port.
This parameter is used to reset the built-in EtherNet/IP port
when you change the IP address or other parameter settings
and want to apply them.
Not sup- Support-
Input one of the following values for the ServiceDat input vari-
ported ed
able to the CIPSend instruction to specify the reset method.
00 hex: Resets the built-in EtherNet/IP port.
02 hex*1: Clears the saved tag data link settings and resets
the built-in EtherNet/IP port.
*1. The value is 01 hex for a CPU Unit with unit version 1.09 or earlier.
Class ID
Specify 01 hex.
Instance ID
Specify 00 or 01 hex.
Attribute ID
The attribute ID specifies the information to read.
 Class Attribute ID
The class attribute ID specifies the attribute of the entire object.
Read data
Attrib-
Attribute ID Parameter name Description Data
ute Value
type
01 hex Revision Revision of the object Read UINT 0001 hex
02 hex Max Instance The maximum instance num- Read UINT 0001 hex
ber
 Instance Attribute ID
The instance attribute ID specifies the attribute of the instance.
Read data
Attribute ID Parameter name Description Attribute Data
Value
type
01 hex Vendor ID Vendor ID Read UINT 002F hex
02 hex Device Type Device type Read UINT 000C hex
03 hex Product Code Product code Read UINT Refer to (1) Product Codes
for Each Model, below.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-49
7-5
CIP
Object
Services
7
7-5-2
Identity
Object
(Class
ID:
01
hex)
7 CIP Message Communications
Read data
Attribute ID Parameter name Description Attribute Data
Value
type
04 hex Revision Device revision Read Struct ---
Major Revision Major revision Read USINT Refer to (2) Major and Minor
Minor Revision Minor revision Read USINT CIP Revisions, below.
05 hex Status Status of the built-in Ether- Read WORD Refer to (3) Status Details of
Net/IP port the Built-in EtherNet/IP Port,
below.
06 hex Serial Number Serial number Read UDINT Set value
07 hex Product Name Product name Read STRIN Refer to (1) Product Names
G for Each Model, below.


Question: Product Codes and Product Names for Each Model

Answer:
Product
Model Product Name
Code
NX701-1600 067D hex 4E583730312D31363030 Hex
NX701-1620 4E583730312D31363230 Hex
NX701-1700 4E583730312D31373030 Hex
NX701-1720 4E583730312D31373230 Hex
NX701-Z600 4E583730312D5A363030 Hex
NX701-Z700 4E583730312D5A373030 Hex
NX502-1300 0BF5 hex 4E583530322D31333030 Hex
NX502-1400 0BF6 hex 4E583530322D31343030 Hex
NX502-1500 0BF7 hex 4E583530322D31353030 Hex
NX502-1600 0C00 hex 4E583530322D31363030 Hex
NX502-1700 0C01 hex 4E583530322D31373030 Hex
NX102-1200 0BBB hex 4E583130322D31323030 Hex
NX102-1100 0BBA hex 4E583130322D31313030 Hex
NX102-1000 0BB9 hex 4E583130322D31303030 Hex
NX102-9000 0BB8 hex 4E583130322D39303030 Hex
NX102-1220 0BBF hex 4E583130322D31323230 Hex
NX102-1120 0BBE hex 4E583130322D31313230 Hex
NX102-1020 0BBD hex 4E583130322D31303230 Hex
NX102-9020 0BBC hex 4E583130322D39303230 Hex
NX1P2-9B24DT 068B hex 4E583150322D394232344454 Hex
NX1P2-9B24DT1 4E583150322D39423234445431 Hex
NX1P2-9B40DT 4E583150322D394234304454 Hex
NX1P2-9B40DT1 4E583150322D39423430445431 Hex
NX1P2-9024DT 4E583150322D393032344454 Hex
NX1P2-9024DT1 4E583150322D39303234445431 Hex
NX1P2-1040DT 4E583150322D313034304454 Hex
NX1P2-1040DT1 4E583150322D31303430445431 Hex
NX1P2-1140DT 4E583150322D313134304454 Hex
NX1P2-1140DT1 4E583150322D31313430445431 Hex
NJ501-1300 0665 hex 4E4A3530312D31333030 Hex
NJ501-1320 4E4A3530312D31333230 Hex
NJ501-1340 4E4A3530312D31333430 Hex
7-50 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Product
Model Product Name
Code
NJ501-1400 0666 hex 4E4A3530312D31343030 Hex
NJ501-1420 4E4A3530312D31343230 Hex
NJ501-1500 0667 hex 4E4A3530312D31353030 Hex
NJ501-1520 4E4A3530312D31353230 Hex
NJ501-4300 066E hex 4E4A3530312D34333030 Hex
NJ501-4310 4E4A3530312D34333130 Hex
NJ501-4320 4E4A3530312D34333230 Hex
NJ501-4400 066F hex 4E4A3530312D34343030 Hex
NJ501-4500 0670 hex 4E4A3530312D34353030 Hex
NJ501-5300 068C hex 4E4A3530312D35333030 Hex
NJ501-R300 069C hex 4E4A3530312D52333030 Hex
NJ501-R400 069D hex 4E4A3530312D52343030 Hex
NJ501-R500 069E hex 4E4A3530312D52353030 Hex
NJ501-R320 069F hex 4E4A3530312D52333230 Hex
NJ501-R420 06A0 hex 4E4A3530312D52343230 Hex
NJ501-R520 06A1 hex 4E4A3530312D52353230 Hex
NJ301-1100 066B hex 4E4A3330312D31313030 Hex
NJ301-1200 066C hex 4E4A3330312D31323030 Hex
NJ101-9000 0680 hex 4E4A3130312D39303030 Hex
NJ101-1000 4E4A3130312D31303030 Hex
NJ101-9020 4E4A3130312D39303230 Hex
NJ101-1020 4E4A3130312D31303230 Hex


Question: Major and Minor CIP Revisions

Answer:
CIP revisions
Unit version
Major revision Minor revision
Unit version 1.00 01 hex 01 hex
Unit version 1.01 or 1.02 03 hex
Unit version 1.03 to 1.08 02 hex 01 hex
Unit version 1.09 02 hex
Unit version 1.10 03 hex
Unit version 1.11 or 1.12 04 hex
Unit version 1.13 to 1.20 05 hex
Unit version 1.21 or later 06 hex
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-51
7-5
CIP
Object
Services
7
7-5-2
Identity
Object
(Class
ID:
01
hex)
7 CIP Message Communications
CIP revisions
Model Unit version
Major revision Minor revision
All CPU Unit Unit version 1.00 01 hex 01 hex
models Unit version 1.01 or 1.02 03 hex
Unit version 1.03 to 1.08 02 hex 01 hex
Unit version 1.09 02 hex
Unit version 1.10 03 hex
Unit version 1.11 or 1.12 04 hex
Unit version 1.13 to 1.20 05 hex
NJ Series Unit version 1.21 to 1.23 06 hex
Unit version 1.26 08 hex
Unit version 1.27 09 hex
Unit version 1.40 to 1.41 06 hex
Unit version 1.46 08 hex
Unit version 1.47 09 hex
NX Series Unit version 1.21 to 1.22 06 hex
Unit version 1.28 09 hex
Unit version 1.30 to 1.43 06 hex
Unit version 1.44 08 hex
Unit version 1.60 0A hex