Question: Status Details of the Built-in EtherNet/IP Port

Answer:
Bit Name Description
0 Owned Indicates when the built-in EtherNet/IP port has an open connection as the
target of a tag data link.
1 Reserved Always FALSE.
2 Configured Tag data link settings exist.
3 Reserved Always FALSE.
4 to 7 Extended Device Status Indicates the status of the built-in EtherNet/IP port.*1
8 Minor Recoverable Fault TRUE when any of the following errors occurs.
• IP Route Table Setting Error
• DNS Server Connection Error
• Tag Data Link Setting Error
• Tag Data Link Timeout
• Tag Data Link Connection Timeout
• FTP Server Setting Error
• NTP Client Setting Error
• SNMP Setting Error
• NTP Server Connection Error
• Tag Name Resolution Error
9 Minor Unrecoverable Fault TRUE when the following error occurs.
• Identity Error
10 Major Recoverable Fault TRUE when any of the following errors occurs.
• IP Address Duplication Error
• BOOTP Server Error
• DHCP Server Connection Error
• Basic Ethernet Setting Error
• IP Address Setting Error
7-52 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Bit Name Description
11 Major Unrecoverable Fault TRUE when any of the following errors occurs.
• Communications Controller Error
• MAC Address Error
12 to 15 Reserved Always FALSE.
*1. Bits 7 to 4 indicate the status of the built-in EtherNet/IP port.
b7 b6 b5 b4
0 1 0 1 A major fault occurred.
0 0 1 0 A timeout occurred in one or more target connections.
0 0 1 1 Indicates that there are no tag data link settings.
0 1 1 0 Indicates that one or more connections are performing communications
normally.
0 1 1 1 Other than the above.
Request Paths (IOIs) to Specify Objects
When you specify an object, specify the request path (IOI) for each service code as given below.
Service code Class ID Instance ID Attribute ID
01 hex Get_Attribute_All 01 hex • Specifying a service for a class Not required.
0E hex Get_Attribute_Single : 00 hex • Reading a class attribute
• Specifying a service for an in- : 01 or 02 hex
stance • Reading an instance attribute
: Always 01 hex : 01 to 07 hex
05 hex Reset Always 01 hex Not required.
7-5-3 NX Configuration Object (Class ID: 74 hex)
This object is used to control the NX Unit on the CPU Rack such as reading and writing an NX object,
restarting the NX Unit, obtaining an event log and current errors, and clearing the log. This can only be
used for the NX502 CPU Units and NX102 CPU Units.
Service Codes
Specify the service to execute with the service code.
Supported serv-
Service ices
Parameter name Description Reference
Code Classe Instan-
s ces
33 hex Read NX object Reads the NX object of the specified NX Unit. Not Support- page 7-54
sup- ed.
ported.
34 hex Write NX object Writes the NX object of the specified NX Unit. Not Support- page 7-56
sup- ed.
ported.
35 hex Restart NX unit Restarts the specified NX Units. Not Support- page 7-57
sup- ed.
ported.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-53
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
Supported serv-
Service ices
Parameter name Description Reference
Code Classe Instan-
s ces
36 hex Save parameter Saves the parameters of the specified NX Not Support- page 7-58
Unit. sup- ed.
ported.
37 hex Switch parameter write Switches the parameter write mode of the Not Support- page 7-59
mode specified NX Units. sup- ed.
ported.
38 hex Read total power on Reads the total power on time of the specified Not Support- page 7-61
time NX Unit. sup- ed.
ported.
3A hex Get current error Obtains the current errors of the Controller or Not Support- page 7-62
specified NX Unit. sup- ed.
ported.
3B hex Get event log Obtains the event log of the Controller or Not Support- page 7-65
specified NX Unit. sup- ed.
ported.
3C hex Clear event log Clears the event log of the Controller or speci- Not Support- page 7-69
fied NX Unit. sup- ed.
ported.
3D hex Initialize unit operation Initializes the Unit operation settings (NX ob- Not Support- page 7-70
parameter ject) of the specified NX Unit. sup- ed.
ported.
3E hex Get current user error Obtains the user-defined errors of the Control- Not Support- page 7-72
ler. sup- ed.
ported.
Class ID
Specify 74 hex.
Instance ID
Specify 01 hex.
Read NX object (Service Code: 33 hex)
Read the NX object of the specified NX Unit.
 Request Data Format
Parameter name Data type Description
Service USINT Read NX object service: 33 hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
7-54 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Parameter name Data type Description
Unit No UINT Unit number
0001 to 003F hex: NX Unit*1
Index UINT NX object index
Sub index USINT NX object sub index
Control Field USINT Complete access specification
00 hex: Not specified
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Read NX object service response: B3 hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
Length UINT Read data size (Byte)
Read data Depends on data Read data
type
When the processing failed
Parameter name Data type Description
Reply Service USINT Read NX object service response: B3 hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
10 Device state conflict The state of the NX object is not in a state to execute the re-
quired service.
11 Reply data too large Data larger than the maximum response data length was
read.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-55
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
General sta-
tus code Error name Cause
(hex)
20 Invalid parameter • The Unit number is out of the supported range.
• The object of the index specified for the NX object does
not exist.
• The Index specified for the NX object exists but the Sub
Index does not exist.
Write NX Object (Service Code: 34 hex)
Write the NX object of the specified NX Unit.
 Request Data Format
Parameter name Data type Description
Service USINT Write NX object service: 34 hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0001 to 003F hex: NX Unit*1
Index UINT NX object index
Sub index USINT NX object sub index
Control Field USINT Complete access specification
00 hex: Not specified
Length UINT Write data size (Byte)
Write Data Depends on data Write data
type
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Write NX object service response: B4 hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
When the processing failed
Parameter name Data type Description
Reply Service USINT Write NX object service response: B4 hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
7-56 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
*2. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
0E Attribute not settable The NX object which is not modifiable is specified.
10 Device state conflict • Carried out writing in a state that was not the parameter
write mode.
• The state of the NX object is not in a state to execute the
required service.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The sizes of the specified object and Length do not match.
• The object of the index specified for the NX object does
not exist.
• The Index specified for the NX object exists, but the Sub
Index does not exist.
• Write data is out of the range.
Restart NX Unit (Service Code: 35 hex)
Restart the specified NX Units.
 Request Data Format
Parameter name Data type Description
Service USINT Restart NX Unit service: 35 hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0000 hex: All NX Units
0001 to 003F hex: NX Unit*1
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Restart NX Unit service response: B5 hex
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-57
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
Parameter name Data type Description
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
When the processing failed
Parameter name Data type Description
Reply Service USINT Restart NX Unit service response: B5 hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP*1
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*2
Additional Status UINT Additional Status*3
*1. When the request is made to an NX Unit that does not support the Restart NX Unit service, error codes
are returned. (General status: 1F hex, Additional status: 2601 hex)
*2. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*3. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
10 Device state conflict The target Unit is not in a state to execute the required serv-
ice.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The unit number is out of the supported range.
• The Unit does not exist.
Save Parameter (Service Code: 36 hex)
Save the parameters of the specified NX Unit.
The saved parameter is valid after the NX Unit is restarted.
 Request Data Format
Parameter name Data type Description
Service USINT Save parameter service: 36 hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
7-58 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Parameter name Data type Description
Unit No UINT Unit number
0001 to 003F hex: NX Unit*1
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Save parameter service response: B6 hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
When the processing failed
Parameter name Data type Description
Reply Service USINT Save parameter service response: B6 hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
19 Store operation failure The parameters could not be saved due to internal reasons.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The Unit does not exist.
Switch Parameter Write Mode (Service Code: 37 hex)
Switch the parameter write mode of the specified NX Units.
 Request Data Format
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-59
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
Parameter name Data type Description
Service USINT Switch parameter write mode service: 37 hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0000 hex: All NX Units
0001 to 003F hex: NX Unit*1
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Switch parameter write mode service response: B7
hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
When the processing failed
Parameter name Data type Description
Reply Service USINT Switch parameter write mode service response: B7
hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
10 Device state conflict This service could not change because the transition to the
parameter write mode is in progress.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The Unit does not exist.
7-60 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Read Total Power On Time (Service Code: 38 hex)
Read the total power on time of the specified NX Unit.
 Request Data Format
Parameter name Data type Description
Service USINT Read total power on time service: 38 hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0001 to 003F hex: NX Unit*1
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Read total power on time service response: B8 hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
Total power on time ULINT Total power on time of NX Units.
When the processing failed
Parameter name Data type Description
Reply Service USINT Read total power on time service response: B8 hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-61
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
General sta-
tus code Error name Cause
(hex)
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The Unit does not exist.
Get Current Error (Service Code: 3A hex)
Obtain the current errors of the Controller or specified NX Unit.
 Request Data Format
Parameter name Data type Description
Service USINT Get current error service: 3A hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0000 hex: Controller
0001 to 003F hex: NX Unit*1
Start number of read record UINT Top number of read record
Number of read record UINT Number of read records
Controller (0 to 5)
NX Units (0 to 9)
When the registered number of records is smaller
than the number of read records, an error does not
occur, and all the registered event codes are read.
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Get current error service response: BA hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
Error update count UINT Total count value of errors
Record size UINT Size of one record (Byte)
Controller error: 0060 hex
NX Unit error: 0032 hex
Number of registered record UINT Number of registered records
Number of readout record UINT Number of readout records
7-62 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Parameter name Data type Description
Current error record[0] Array of struct Cur- Current error array
to rent error record Stores data for the "Number of readout record" from
Current error record[8] index 0 of the current error record. The remaining
elements of the current error record array are not
included in the response data.
Example: When the "Number of readout record" is 3
and the response data includes the current error re-
cord array [0-2], the current error record array [3-8]
is not included in the response data.
For details of the specifications of the structure, re-
fer to Current Error Record Structure on page
7-63.
When the processing failed
Parameter name Data type Description
Reply Service USINT Get current error service response: BA hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 Current Error Record Structure
The format of the current error record information differs between the Controller and NX Unit.
Controller
Parameter name Data type Description
Index UDINT Current error index number
This number is assigned when system event logs
and access event logs are registered.
Event occurred time ULINT Error occurred time
Event source UINT Error source
Event priority UINT Error level
Event code UDINT Event code
Code system UINT Code system
Event source details UINT Error source details
Reserved UDINT Reserved
Vendor code UDINT Vendor code
Device type code UDINT Device type code
Product code UDINT Product code of the Unit in which errors occurred
Additional information[0] Array of BYTE Attached information (system information) of event.
to
Additional information[31]
Reserved[0] Array of BYTE Reserved
to
Reserved[23]
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-63
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
NX Unit
Parameter name Data type Description
Index UDINT Current error index number
This number is assigned when system event logs
and access event logs are registered.
Unit number USINT Unit number
0000 hex: Controller
0001 to 003F hex: NX Unit*1
Event priority USINT Error level
Event occurred time UDINT Error occurred time
Product code UDINT Product code of the Unit in which errors occurred
Event code UDINT Event code
Additional information[0] Array of BYTE Attached information (system information) of event.
to
Additional information[31]
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The specification of the number of readout records is out
of the range.
• The Unit does not exist.
 Method of Use
1
The following variables are generated and initialized to 0.
• Total number of readout records (UINT)
• Previous error update count (UINT)
2
Specify the following parameters and execute Get current error (3A hex).
• Unit No: Unit number subject to error information read
• Start number of read record: 0
• Number of read record: Number of read records
3
The following parameters are read from the response data.
• Error update count
• Number of registered record
7-64 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
• Number of readout record
• Current error record
When the first response is obtained, the value of Error update count is retained as the previous
error update count.
When the second response onwards is obtained, the previous error update count and the Error
update count are compared. If the value is updated with any additional current errors of the
Unit, execute this operation from step1 again.
4
Add the Number of readout record value of the response data to the total number of readout
records.
5
If the total number of readout records does not reach the Number of registered record, it
means that some records have not been read yet. Specify the following parameters and exe-
cute Get current error again.
• Start number of read record: Start number of read record when the previous service was
executed + Number of readout record of response.
• Number of read record: Number of read records
Repeat steps (3) to (5) until the total number of readout records matches the Number of registered
record.
Get Event Log (Service Code: 3B hex)
Obtain the event log of the Controller or specified NX Unit.
When the Controller is specified, the event log saved in the Controller is obtained. Event logs of slaves
connected to the Controller such as EtherCAT slaves cannot be obtained.
 Request Data Format
Parameter name Data type Description
Service USINT Get event log service: 3B hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0000 hex: Controller
0001 to 003F hex: NX Unit*1
Event log type UINT Event log type
0000 hex: System event log
0001 hex: Access event log
0002 hex: User event log
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-65
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
Parameter name Data type Description
Start index of read record UDINT Top index number of read record
If the record specified by the Start index of read re-
cord is not found in the Unit, the record will be read
from the oldest index. If the maximum number of
event log records which can be registered for the
Unit is exceeded, this will occur since old records
are overwritten by new records.
Number of read record UINT Number of read records
Controller (0 to 5)
NX Units (0 to 9)
When the registered number of records is smaller
than the number of read records, an error does not
occur, and all the registered event logs are read.
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Get event log service response: BB hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
Record size UINT Size of one record (Byte)
Controller event log: 0060 hex
NX Unit event log: 0032 hex
Number of registered record UINT Number of registered records
Latest index of registered record UDINT Index number of the latest registered record
Last index of readout record UDINT Index number of last readout record
Number of readout record UINT Number of readout records
Reserved UINT Reserved
Event log record[0] Array of struct Event log array
to Event Log Record Stores data for the "Number of readout record" from
Event log record[8] index 0 of the event log record. The remaining ele-
ments of the event log record array are not included
in the response data.
Example: When the "Number of readout record" is 3
and the response data includes the event log re-
cord array [0-2], the event log record array [3-8] is
not included in the response data.
For details of the specifications of the structure, re-
fer to Event Log Record Structure on page 7-67.
When the processing failed
Parameter name Data type Description
Reply Service USINT Get event log service response: BB hex
Reserved USINT Reserved: 00 hex
7-66 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Parameter name Data type Description
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 Event Log Record Structure
The format of the event log record information differs between the Controller and NX Unit.
Controller system event log and access event log
Parameter name Data type Description
Index UDINT Event log index number
This number is assigned when system event logs
and access event logs are registered.
Event occurred time ULINT Event occurred time
Event source UINT Event source
Event priority UINT Event level
Event code UDINT Event code
Code system UINT Code system
Event source details UINT Event source details
Reserved UDINT Reserved
Vendor code UDINT Vendor code
Device type code UDINT Device type code
Product code UDINT Product code of the Unit in which event occurred
Additional information[0] Array of BYTE Attached information (system information) of event.
to
Additional information[31]
Reserved[0] Array of BYTE Reserved
to
Reserved[23]
Controller user event log
Parameter name Data type Description
Index UDINT Event log index number
This number is assigned when system event logs
and access event logs are registered.
Event occurred time ULINT Event occurred time
Event source UINT Event source
Event priority UINT Event level
Event code UDINT Event code
Event priority details UINT Event level details
Additional information[0] Array of BYTE Attached information (system information) of event.
to
Additional information[39]
Reserved[0] Array of BYTE Reserved
to
Reserved[31]
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-67
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
NX Unit
Parameter name Data type Description
Index UDINT Event log index number
This number is assigned when system event logs
and access event logs are registered.
Unit number USINT Unit number
0000 hex: Controller
0001 to 003F hex: NX Unit*1
Event priority USINT Event level
Event occurred time UDINT Event occurred time
Product code UDINT Product code of the Unit in which event occurred
Event code UDINT Event code
Additional information[0] Array of BYTE Attached information (system information) of event.
to
Additional information[31]
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The specification of the number of readout records is out
of the range.
• The Unit does not exist.
 Method of Use
1
The following variables are generated and initialized to 0.
• Total number of readout records (UINT)
• Record index during the previous readout (UDINT)
• Previous latest record index (UDINT)
2
Specify the following parameters and execute Get event log(3B hex).
• Unit No: Unit number subject to event information readout
• Start number of read record: 0
• Number of read record: Number of read records
3
The following parameters are read from the response data.
• Number of registered record
7-68 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
• Latest index of registered record
• Last index of readout record
• Number of readout record
• Event log record
When the first response is obtained, the value of Latest index of registered record value is re-
tained as the record index during the previous readout.
When the second response onwards is obtained, the record index during the previous readout
and Latest index of registered record value are compared. If the value is updated with any ad-
ditional event logs of the Unit, execute this operation from step1 again.
4
Add the Number of readout record value of the response data to the total number of readout
records.
5
If the total number of readout records does not reach the Number of registered record, it
means that some records have not been read yet. Specify the following parameters and exe-
cute Get event log again.
• Start number of read record: Last index of readout record when the previous service was
executed + 1.
• Number of read record: Number of read records
Repeat steps (3) to (5) until the total number of readout records matches the Number of registered
record.
Clear Event Log (Service Code: 3C hex)
Clear the event log of the Controller or specified NX Unit.
The event log is immediately cleared after the service is successful. When it is executed for the Con-
troller, only the event log saved in the Controller is cleared. Event logs of slaves connected to the Con-
troller such as EtherCAT slaves are not cleared.
 Request Data Format
Parameter name Data type Description
Service USINT Clear event log service: 3C hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0000 hex: Controller
0001 to 003F hex: NX Unit*1
Event log type UINT Event log type
0000 hex: System event log
0001 hex: Access event log
0002 hex: User event log*2
0003 hex: All types of the system event log, access
event log, user event log.
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
*2. The User event log is valid only when the Controller is specified for the Unit number.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-69
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Clear event log service response: BC hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
When the processing failed
Parameter name Data type Description
Reply Service USINT Clear event log service response: BC hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The Unit does not exist.
Initialize Unit Operation Parameter (Service Code: 3D hex)
Initializes the Unit operation settings (NX object) of the specified NX Unit.
The initialized parameters are valid after the NX Unit is restarted.
By executing this service, NX Unit Memory All Cleared (95810000 hex) is registered in the event log.
When the NX Unit is Operational or Safe-Operational, you need to initialize the status beforehand with
the Switch parameter write mode service. If the Initialize unit operation parameter is executed without
carrying out this step, error will result, and Device state conflict (10 hex) will be returned to the General
Status.
This service does not support the NX-series Safety Control Unit. If this service is executed for the
NXseries Safety Control Unit, an error will occur.
 Request Data Format
7-70 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Parameter name Data type Description
Service USINT Initialize unit operation parameter service: 3D hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0001 to 003F hex: NX Unit*1
*1. The range is 0001 to 0020 hex for an NX102 CPU Unit.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Initialize unit operation parameter service response:
BD hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
When the processing failed
Parameter name Data type Description
Reply Service USINT Initialize unit operation parameter service response:
BD hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
10 Device state conflict The device state is not in a state to execute the required
service.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The Unit does not exist.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-71
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
Get Current User Error (Service Code: 3E hex)
Obtain the user-defined errors of the Controller.
 Request Data Format
Parameter name Data type Description
Service USINT Get current user error service: 3E hex
Request Path Size USINT Size of Request Path: 02 hex
Request Path Padded EPATH Request path: 2074 2401 hex
Class ID: 74 hex
Instance ID: 01 hex
Unit No UINT Unit number
0000 hex: Controller
0001 hex or above: Not supported
Start number of read record UINT Top number of read record
Number of read record UINT Number of read records (0 to 5)
When the registered number of records is smaller
than the number of read records, an error does not
occur, and all the registered event logs are read.
 Response Data Format
When the processing is successful
Parameter name Data type Description
Reply Service USINT Get current user error service response: BE hex
Reserved USINT Reserved: 00 hex
General Status USINT Code indicating normal: 00 hex
Size of Additional Status USINT Size of Additional Status: 00 hex
Error update count UINT Total count value of errors
Record size UINT Size of one record (Byte):0060 hex
Number of registered record UINT Number of registered records
Number of readout record UINT Number of readout records
User error record[0] Array of struct User User-defined error array
to error record Stores data for the "Number of readout record" from
User error record[8] index 0 of the User error record. The remaining ele-
ments of the User error record array are not includ-
ed in the response data.
Example: When the "Number of readout record" is 3
and the response data includes the User error re-
cord array [0-2], the User error record array [3-8] is
not included in the response data.
For details of the specifications of the structure, re-
fer to User Error Record Structure.
When the processing failed
Parameter name Data type Description
Reply Service USINT Get current user error service response: BE hex
Reserved USINT Reserved: 00 hex
General Status USINT Current error code defined by CIP
7-72 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Parameter name Data type Description
Size of Additional Status USINT Size of Additional Status: 00 hex or 01 hex*1
Additional Status UINT Additional Status*2
*1. When the General Status of the response code is 1F hex (Vendor specific error), becomes 01 hex.
*2. This is stored only when the Size of Additional Status is 01 hex.
 User Error Record Structure
Parameter name Data type Description
Index UDINT User-defined error index number
This number is assigned when system event logs
and access event logs are registered.
Event occurred time ULINT Error occurred time
Event source UINT Error source
Event priority UINT Error level
Event code UDINT Event code
Event priority details UINT Error level details
Reserved UINT Reserved
Additional information[0] Array of BYTE Attached information (system information) of event.
to
Additional information[39]
Reserved[0] Array of BYTE Reserved
to
Reserved[31]
 CIP Error Codes
General sta-
tus code Error name Cause
(hex)
02 Resource unavailable Resources needed for the object to perform the requested
service were unavailable.
0C Object state conflict The object cannot perform the requested service in its cur-
rent mode/state.
13 Not enough data Data required for the execution of the required service is in-
sufficient.
15 Too much data Extra data for the execution of the required service is includ-
ed.
1F Vendor specific error The service could not be executed due to internal reasons.
20 Invalid parameter • The Unit number is out of the supported range.
• The Unit does not exist.
 Method of Use
1
The following variables are generated and initialized to 0.
• Total number of readout records (UINT)
• Previous error update count (UINT)
2
Specify the following parameters and execute Get current user error (3E hex).
• Unit No: Unit number subject to error information readout
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-73
7-5
CIP
Object
Services
7
7-5-3
NX
Configuration
Object
(Class
ID:
74
hex)
7 CIP Message Communications
• Start number of read record: 0
• Number of read record: Number of read records
3
The following parameters are read from the response data.
• Error update count
• Number of registered record
• Number of readout record
• User error record
When the first response is obtained, the value of Error update count is retained as the previous
error update count.
When the second response onwards is obtained, the previous error update count and the Error
update count are compared. If the value is updated with any additional user-defined errors of
the Unit, execute this operation from step1 again.
4
Add the Number of readout record value of the response data to the total number of readout
records.
5
If the total number of readout records does not reach the Number of registered record, it
means that some records have not been read yet. Specify the following parameters and exe-
cute Get current error again.
• Start number of read record: Start number of read record when the previous service was
executed + Number of readout record of response.
• Number of read record: Number of read records
Repeat steps (3) to (5) until the total number of readout records matches the Number of registered
record.
7-5-4 TCP/IP Interface Object (Class ID: F5 hex)
This object is used to read and write settings such as the IP address, subnet mask, and default gate-
way.
For NX701 CPU Units, NX502 CPU Units, and NX102 CPU Units, it is necessary to use the route path
of the CIP communications instruction (the RoutePath input variable) 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.
Service Supported services
Parameter name Description
code Classes Instances
01 hex Get_Attribute_All Reads the values of the attributes. Supported Not sup-
ported
0E hex Get_Attribute_Single Reads the value of the specified attribute. Supported Supported
7-74 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Service Supported services
Parameter name Description
code Classes Instances
10 hex Set_Attribute_Single Writes a value to the specified attribute. Not sup- Supported
The built-in EtherNet/IP port restarts automatically after ported
the value is written to the attribute.
When the next Set_Attribute_Single is executed before
the restart process is completed, the general status "0C
hex" (Object State Conflict) is returned.
Class ID
Specify F5 hex.
Instance ID
Specify 00 or 01 hex.
00: Specify the class
01: Built-in EtherNet/IP Port
Attribute ID
The attribute ID specifies the information to read.
 Class Attribute ID
The class attribute ID specifies the attribute of the entire object.
At- Read data
Attrib-
Parameter name Description trib-
ute ID Data type Value
ute
01 hex Revision Revision of the object Read UINT 0001 hex: Unit version 1.01 or
earlier
0002 hex: Unit version 1.02 to


Answer:
0003 hex: Unit version 1.10
0004 hex: Unit version 1.11 or
later
02 hex Max Instance The maximum instance num- Read UINT 0001 hex
ber
03 hex Number of Instances The number of object instan- Read UINT 0001 hex
ces
 Instance Attribute ID
The instance attribute ID specifies the attribute of the instance.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-75
7-5
CIP
Object
Services
7
7-5-4
TCP/IP
Interface
Object
(Class
ID:
F5
hex)
7 CIP Message Communications
Read/write data
Attrib-
Attribute ID Parameter name Description Data
ute Value
type
01 hex Interface Configura- Indicates the IP address set- Read DWOR Bits 0 to 3: Interface Configu-
tion Status ting status of the interface. D ration Status:
0 = IP address is not set. (This
includes when BOOTP is
starting.)
1 = IP address is set.
Bits 4 and 5: Reserved (al-
ways FALSE).
Bit 6: AcdStatus*1:
FALSE = IP address collisions
have not been detected.
TRUE = IP address collisions
have been detected.
Bits 7 to 31: Reserved (always
FALSE).
02 hex Configuration Capabil- Indicates a Controller Con- Read DWOR Bit 0: BOOTP Client: Always
ity figurations and Setup that D TRUE.
can be set to the interface. Bit 1: DNS Client: Always
TRUE.
Bit 2: DHCP Client: *4
Bit 3: DHCP-DNS Update: Al-
ways FALSE.
Bit 4: Configuration Settable:
Always TRUE.
Bit 5: Hardware Configurable:
Always FALSE.
Bit 6: Interface Configuration
Change Requires Reset: Al-
ways FALSE.
Bit 7: ACD Capable*1: Always
TRUE.
Bits 8 to 31: Reserved (always
FALSE).
03 hex Configuration Control Sets the method used to set Read/ DWOR Bit 0 to 3: IP Address Setting
the IP address when the in- Write D Method
terface starts. 0 = Setting the static IP ad-
dress.
1 = Setting by BOOTP.
2 = Setting by DHCP
Bit 4: DNS Enable/Disable
Setting
FALSE = DNS disabled.
TRUE = DNS enabled.
Bits 5 to 31: Reserved (always
FALSE).
04 hex Physical Link Object The path to the link object in Read Struct ---
the physical layer.
Path size The path size (WORD size). UINT 0002 hex
Path The path to the link object in EPATH 20 F6 24 01 hex
the physical layer (static).
7-76 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Read/write data
Attrib-
Attribute ID Parameter name Description Data
ute Value
type
05 hex Interface Configura- The interface settings. Read/ Struct ---
tion Write
IP Address IP address. UDINT Set value
Network Mask Subnet mask. UDINT Set value
Gateway Address The default gateway. UDINT Set value
Name Server The primary name server. UDINT Set value
Name Server2 The secondary name server. UDINT Set value
Domain Name The domain name. STRIN Set value*2
G
06 hex Host Name The host name (reserved). Read/ STRIN Set value*3
Write G
*1. The value is always FALSE for a CPU Unit with unit version 1.01 or earlier.
*2. The value is the size of domain name (2 bytes) + domain name (48 bytes max.).
*3. The value is the size of host name (2 bytes) + host name (64 bytes max.).
*4. The value is always TRUE for CPU Units that support the DHCP client. The value is always FALSE for unsupported
CPU Units.
Refer to A-1 Functional Comparison of EtherNet/IP Ports on NJ/NX-series CPU Units and Other Series on page A-3
for checking whether the CPU Unit that you use supports the DHCP client.
Request Paths (IOIs) to Specify Objects
When you specify an object, specify the request path (IOI) for each service code as given below.
Class
Service code Instance ID Attribute ID
ID
01 hex Get_Attribute_All F5 hex • Specifying a service for a class: 00 Not required.
0E hex Get_Attribute_Single hex • Reading a class attribute: 01
10 hex Set_Attribute_Single • Specifying a service for an in- or 03 hex
stance: 01 hex • Reading and writing an in-
stance attribute: 01 to 06 hex
7-5-5 Ethernet Link Object (Class ID: F6 hex)
This object is used to set and read Ethernet communications and read Ethernet communications sta-
tus information.
For NX701 CPU Units, NX502 CPU Units, and NX102 CPU Units, it is necessary to use the route path
of the CIP communications instruction (the RoutePath input variable) 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.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-77
7-5
CIP
Object
Services
7
7-5-5
Ethernet
Link
Object
(Class
ID:
F6
hex)
7 CIP Message Communications
Supported
Service
Parameter name Description service range
code
Class Instance
0E hex Get_Attribute_Single Reads the value of the specified attribute. Support- Support-
ed ed
10 hex Set_Attribute_Single Writes a value to the specified attribute. Support- Support-
ed ed
4C hex Get_and_Clear Specify Attribute4 or Attribute5 to reset the value of the Not sup- Support-
attribute to 0. ported ed
Class ID
Specify F6 hex.
Instance ID
Specify 00 or 01 hex.
00: Specify the class
01: Built-in EtherNet/IP Port
Attribute ID
The attribute ID specifies the information to read.
 Class Attribute ID
The class attribute ID specifies the attribute of the entire object.
At- Read data
Attrib-
Parameter name Description trib-
ute ID Data type Value
ute
01 hex Revision Revision of the object Read UINT 0002 hex: Unit version 1.11 or
earlier
0004 hex: Unit version 1.12 or
later
02 hex Max Instance The maximum instance num- Read UINT 0001 hex
ber
03 hex Number of Instances The number of object instan- Read UINT 0001 hex
ces
 Instance Attribute ID
The instance attribute ID specifies the attribute of the instance.
Read/write data
Attribute Attrib-
Parameter name Description Data
ID ute Value
type
01 hex Interface Speed Gives the baud rate for the in- Read UDINT Reads the current value.
terface.
02 hex Interface Flags Gives the status of the inter- Read DWOR Refer to (1) Interface Flag
face. D Details, below.
7-78 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Read/write data
Attribute Attrib-
Parameter name Description Data
ID ute Value
type
03 hex Physical Address Gives the MAC address of Read ARRAY Reads the current value of
the interface. [0...5] the MAC address.
OF
USINT
04 hex Interface Counters The number of packets sent/ Read Struct ---
received through the inter-
face.
In Octets The number of octets re- UDINT Reads the current value.
ceived through the interface.
This includes unnecessary
multicast packets and dis-
carded packets counted by
InDiscards.
In Unicast Packets The number of unicast pack- UDINT Reads the current value.
ets received through the inter-
face. This does not include
discarded packets counted by
InDiscards.
In NonUnicast Packets The number of packets be- UDINT Reads the current value.
sides unicast packets re-
ceived through the interface.
This includes unnecessary
multicast packets, but does
not include discarded packets
counted by InDiscards.
In Discards The number of discarded in- UDINT Reads the current value.
coming packets received
through the interface.
In Errors The number of incoming UDINT Reads the current value.
packets that had errors. This
is not included in InDiscards.
In Unknown Protos The number of incoming UDINT Reads the current value.
packets that were of an un-
known protocol.
Out Octets The number of octets sent UDINT Reads the current value.
through the interface.
Out Unicast Packets The number of unicast pack- UDINT Reads the current value.
ets sent through the interface.
Out NonUnicast Pack- The number of packets be- UDINT Reads the current value.
ets sides unicast packets sent
through the interface.
Out Discards The number of discarded sent UDINT Reads the current value.
packets.
Out Errors The number of sent packets UDINT Reads the current value.
that had errors.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-79
7-5
CIP
Object
Services
7
7-5-5
Ethernet
Link
Object
(Class
ID:
F6
hex)
7 CIP Message Communications
Read/write data
Attribute Attrib-
Parameter name Description Data
ID ute Value
type
05 hex Media Counters Media counters for the com- Read Struct ---
munications port.
Alignment Errors Number of frames received UDINT Reads the current value.
that were not octets in length.
FCS Errors Number of frames received UDINT Reads the current value.
that did not pass the FCS
check.
Single Collisions Number of frames sent suc- UDINT Reads the current value.
cessfully with only one colli-
sion.
Multiple Collisions Number of frames sent suc- UDINT Reads the current value.
cessfully with two or more
collisions.
SQE Test Errors Number of times a SQE test UDINT Reads the current value.
error message was generat-
ed.
Deferred Transmis- The number of frames for UDINT Reads the current value.
sions which the first attempt to send
was delayed because the me-
dia was busy.
Late Collisions The number of collisions de- UDINT Reads the current value.
tected in packets that were
sent after 512 bit times.
Excessive Collisions The number of frames that UDINT Reads the current value.
failed to be sent because of
excessive collisions.
MAC Transmit Errors The number of frames that UDINT Reads the current value.
failed to be sent due to an in-
ternal MAC sublayer trans-
mission error.
Carrier Sense Errors The number of times the car- UDINT Reads the current value.
rier sense condition was lost
or the number of times an as-
sertion did not occur when an
attempt was made to send
the frame.
Frame Too Long The number of frames re- UDINT Reads the current value.
ceived that exceeded the
maximum allowed frame size.
MAC Receive Errors The number of frames that UDINT Reads the current value.
could not be received through
the interface due to an inter-
nal MAC sublayer reception
error.
7-80 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Read/write data
Attribute Attrib-
Parameter name Description Data
ID ute Value
type
06 hex Interface Control Control settings for the inter- Read/ Struct ---
face. Write
Control Bits Auto Nego for Ethernet com- WORD Refer to (2) Control Bit De-
munications that specifies full tails, below.
duplex.
Forced Interface Speed Gives the set value of the UINT Reads the set value.
Ethernet baud rate.
0C hex *1 HC Interface Counters The number of packets sent/ Read Struct ---
received through the HC in-
terface.
HCInOctets The number of octets re- ULINT Reads the current value.
ceived through the interface.
This counter is the 64-bit edi-
tion of In Octets.
HCInUnicastPkts The number of unicast pack- ULINT Reads the current value.
ets received through the inter-
face. This counter is the 64-
bit edition of In Ucast Pack-
ets.
HCInMulticastPkts The number of multicast ULINT Reads the current value.
packets received through the
interface.
HCInBroadcastPkts The number of broadcast ULINT Reads the current value.
packets received through the
interface.
HCOutOctets The number of octets sent ULINT Reads the current value.
through the interface.
HCOutUnicastPkts The number of unicast pack- ULINT Reads the current value.
ets sent through the interface.
This counter is the 64-bit edi-
tion of Out Octets.
HCOutMulticastPkts The number of multicast ULINT Reads the current value.
packets sent through the in-
terface.
HCOutBroadcastPkts The number of broadcast ULINT Reads the current value.
packets sent through the in-
terface.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-81
7-5
CIP
Object
Services
7
7-5-5
Ethernet
Link
Object
(Class
ID:
F6
hex)
7 CIP Message Communications
Read/write data
Attribute Attrib-
Parameter name Description Data
ID ute Value
type
0D hex*1 HC Media Counters Media counters for the com- Read Struct ---
munications port.
HCStatsAlignmentEr- The number of frames re- ULINT Reads the current value.
rors ceived that were not octets in
length. This counter is the 64-
bit edition of Alignment Er-
rors.
HCStatsFCSErrors The number of frames re- ULINT Reads the current value.
ceived that did not pass the
FCS check. This counter is
the 64-bit edition of FCS Er-
rors.
HCStatsInternalMac- The number of frames that ULINT Reads the current value.
TransmitErrors failed to be sent due to an in-
ternal MAC sublayer trans-
mission error. This counter is
the 64-bit edition of MAC
Transmit Errors.
HCStatsFrameToo- The number of frames re- ULINT Reads the current value.
Longs ceived that exceeded the
maximum allowed frame size.
This counter is the 64-bit edi-
tion of Frame Too Long.
HCStatsInternalMa- The number of frames that ULINT Reads the current value.
cReceiveErrors could not be received through
the interface due to an inter-
nal MAC sublayer reception
error. This counter is the 64-
bit edition of MAC Receive
Errors.
HCStatsMacSymbolEr- The number of frames that ULINT Reads the current value.
rors could not be received through
the interface due to an inter-
nal MAC sublayer rsymbol er-
ror.
*1. A CPU Unit with unit version 1.13 or later is required to use this attribute.


Question: Interface Flag Details

Answer:
Bit Name Description
0 LinkStatus FALSE: The link is down. TRUE: The link is up.
1 Half/FullDuplex FALSE: Half duplex TRUE: Full duplex
2 to 4 Negotiation Status 00 hex: Auto-negotiation is in progress.
01 hex: Auto-negotiation and speed detection failed.
02 hex: Auto-negotiation failed, but speed detection succeeded.
03 hex: Speed and duplex mode negotiation succeeded.
04 hex: Auto-negotiation was not attempted.
5 Manual Setting Requires Always FALSE: Changes can be applied automatically.
Speed
6 Local Hardware Fault Always FALSE
7-82 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Bit Name Description
7 to 31 Reserved Always FALSE


Question: Control Bit Details

Answer:
Bit Name Description
0 Auto-negotiate FALSE: Auto-negotiation is disabled.
TRUE: Auto-negotiation is enabled.
1 ForcedDuplex Mode FALSE: Half duplex TRUE: Full duplex*1
2 to 16 Reserved Always FALSE
*1. When auto-negotiation is enabled (bit 0 is TRUE), this should always be FALSE.
Request Paths (IOIs) to Specify Objects
When you specify an object, specify the request path (IOI) for each service code as given below.
Class
Service code Instance ID Attribute ID
ID
0E hex Get_Attribute_Single F6 hex • Specifying a service for a class: 00 • Reading a class attribute: 01
10 hex Set_Attribute_Single hex to 03 hex
• Specifying a service for an in- • Reading and writing a in-
stance: Always 01 hex stance attribute: 01 to 06 hex,
0C hex, and 0D hex
4C hex Get_and_Clear Specify an attribute to clear the
value to 0: 04 hex, 05 hex, 0C
hex, 0D hex
7-5-6 Controller Object (Class ID: C4 hex)
This object is used to get the status of the Controller or to change the operating mode of the Control-
ler.
Service Codes
Specify the service to execute with the service code.
Supported service
Service
Parameter name Description range
code
Class Instance
0E hex Get_Attribute_Single Reads the value of the specified attribute. Support- Not sup-
ed ported
10 hex Set_Attribute_Single Writes a value to the specified attribute. Support- Not sup-
ed ported
51 hex Reset_Sys- Clears all errors of CPU Unit. Support- Not sup-
tem_Alarm_All ed ported
Class ID
Specify C4 hex.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-83
7-5
CIP
Object
Services
7
7-5-6
Controller
Object
(Class
ID:
C4
hex)
7 CIP Message Communications
Instance ID
Specify 00 hex.
 Class Attribute ID
The class attribute ID specifies the attribute (value) of the entire object.
Read/write data
Attrib-
Attribute ID Parameter name Description Data
ute Value
type
01 hex Revision Revision of the object Read UINT Always 0002 hex.
02 hex Max Instance The maximum instance num- Read UINT Always 0001 hex.
ber
64 hex PLC Mode This can be used to read and Read/ UINT Specify this when you want
modify the Controller operat- Write to write to an attribute.
ing mode. 0001 hex: PROGRAM
mode
0004 hex: RUN mode
65 hex PLC Error Status Indicates when there is a Read UINT 0000 hex: There is no Con-
Controller error. Changes to troller error.
TRUE when a fatal or non-fa- 0001 hex: There is a Con-
tal error occurs. troller error.
66 hex PLC Model Indicates the model of the Read STRING
Controller. The length is al-
ways 2 bytes for the size +
20 bytes for the name. Un-
used area is padded with
spaces.
 Instance Attribute ID
None
Request Paths (IOIs) to Specify Objects
When you specify an object, specify the request path (IOI) for each service code as given below.
Service code Class ID Instance ID Attribute ID
0E hex Get_Attribute_Single C4 hex 00 hex Specifies the attribute of the
10 hex Set_Attribute_Single class to read or write
: 01 hex, 02 hex, or 64 to 66 hex
7-84 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
7-6 Read and Write Services for Variables
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-6-1 Read Service for Variables
Specify service code 4C hex to read the value of the variable that is specified by the request path.
Service code: 4C hex
 Request Data Format
Request Path Data
Variable name specification
Request Service Data
+0 Num of Element (L) UINT Specify the number of elements to read for an array variable.
+1 (H)
Response Service Data
Data Type USINT Data type of variable to read
AddInfo Length USINT Additional information: Field length in bytes
(AddInfo) Additional information: CRC value of structure
Actual data*
*1. The actual data is stored in little-endian format.
Data Type Code for data type of variable to read. Refer to 7-7-1 Data Type Codes on page 7-89.
AddInfoLength The size of the AddInfo area is stored only when accessing a structure variable.
Set 02 hex for a structure variable. Otherwise, set 00 hex.
AddInfo The CRC code of the structure definition is stored only when accessing a structure vari-
able. In this case, the size of AddInfo will be 2 bytes.
Actual data The actual data is stored in little-endian format.
If 0001 hex is specified for an array, the actual data is stored in the same format as
when you access a variable with the data type of the elements of the array.
Response Codes
CIP Add
Meaning Cause
status status
00 SUCCESS --- The service ended normally.
02 RESOURCE_UNAVAILABLE --- The internal processing buffer is not
available.
04 PATH_SEGMENT_ERROR --- The request path specification is not cor-
rect.
05 PATH_DESTINATION_UNKNOWN --- The variable specification is not correct.
0C OBJECT_STATE_CONFLICT 8010 Downloading, starting up
8011 There is an error in tag memory.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-85
7-6
Read
and
Write
Services
for
Variables
7
7-6-1
Read
Service
for
Variables
7 CIP Message Communications
CIP Add
Meaning Cause
status status
11 REPLY_DATA_TOO_LARGE --- The response exceeds the maximum re-
sponse length.
13 NOT_ENOUGH_DATA --- The data length was too short for the
specified service.
15 TOO_MUCH_DATA --- The data length was too long for the
specified service.
1F VENDOR_SPECIFIC_ERROR 0102,2104 An attempt was made to read an I/O var-
iable that cannot be read.
0104,1103 The specified address and size exceed a
segment boundary.
8001 An internal error occurred.
8007 An inaccessible variable was specified.
8031 An internal error occurred. (A memory al-
location error occurred.)
20 INVALID_PARAMETER 8009 A segment type error occurred.
800F There is an inconsistency in data length
information in the request data
8017 More than one element was specified for
a variable that does not have elements.
8018 Zero elements or data that exceeded the
range of the array was specified for an
array.
8023 An internal error occurred. (An illegal
command format was used.)
8024 An internal error occurred. (An illegal
command length was used.)
8025 An internal error occurred. (An illegal pa-
rameter was used.)
8027 An internal error occurred. (A parameter
error occurred.)
8028 • An attempt was made to write an out-
of-range value for a variable for which
a subrange is specified.
• An attempt was made to write an un-
defined value to an enumeration varia-
ble.
7-6-2 Write Service for Variables
Specify service code 4D hex to write the value of the variable that is specified by the request path.
7-86 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Request Data Format for Writing a Variable
Request Path Data
Variable name specification
Request Service Data
Data Type USINT Data type of variable to write
AddInfo Length USINT Additional information: Field length in bytes
(AddInfo) Additional information: CRC value of structure
Num of Element (L) UINT
(H)
Actual data*
Response Service Data
There is no response service data.
*1. Data to write: Store the data to write in little-endian format.
Data Type Code for data type of variable to write. Refer to 7-7 Variable Data Types on page 7-89.
AddInfoLength Specify the size of the AddInfo area only when accessing a structure variable.
Set 02 hex for a structure variable. Otherwise, set 00 hex.
AddInfo The CRC code of the structure definition is specified only when accessing a structure
variable.
In this case, the size of AddInfo will be 2 bytes.
NumOfElement Specify the number of elements in the array. Do not specify 0000 hex (an error will oc-
cur).
For variables other than arrays, set 0001 hex.
Actual data Specify the actual data in little-endian format.
If 0001 hex is specified for an array, specify the actual data in the same format as when
you access a variable with the data type of the elements of the array.
Response Codes
CIP Add
Meaning Cause
status status
00 SUCCESS --- The service ended normally.
02 RESOURCE_UNAVAILABLE --- The internal processing buffer is not availa-
ble.
04 PATH_SEGMENT_ERROR --- The request path specification is not cor-
rect.
05 PATH_DESTINATION_UNKNOWN --- The link was followed to the end, but the
variable was not found.
0C OBJECT_STATE_CONFLICT 8010 Downloading, starting up
8011 There is an error in tag memory.
13 NOT_ENOUGH_DATA --- The data length was too short for the speci-
fied service.
15 TOO_MUCH_DATA --- The data length was too long for the speci-
fied service.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-87
7-6
Read
and
Write
Services
for
Variables
7
7-6-2
Write
Service
for
Variables
7 CIP Message Communications
CIP Add
Meaning Cause
status status
1F VENDOR_SPECIFIC_ERROR 0102,2103 An attempt was made to write a constant or
read-only variable.
0104,1103 The specified address and size exceed a
segment boundary.
8001 An internal error occurred. (An information
inconsistency was detected in the interface
in the Module.)
8007 An inaccessible variable was specified.
8029 A region that all cannot be accessed at the
same time was specified for SimpleData-
Segment.
8031 An internal error occurred. (A memory allo-
cation error occurred.)
20 INVALID_PARAMETER 8009 A segment type error occurred.
800F There is an inconsistency in data length in-
formation in the Request Data.
8017 More than one element was specified for a
variable that does not have elements.
8018 Zero elements or data that exceeded the
range of the array was specified for an ar-
ray.
8021 A value other than 0 and 2 was specified
for an AddInfo area.
8022 • The data type that is specified in the re-
quest service data does not agree with
the tag information.
• The AddInfo Length in the request serv-
ice data is not 0.
8023 An internal error occurred. (An illegal com-
mand format was used.)
8024 An internal error occurred. (An illegal com-
mand length was used.)
8025 An internal error occurred. (An illegal pa-
rameter was used.)
8027 An internal error occurred. (A parameter er-
ror occurred.)
8028 • An attempt was made to write an out-of-
range value for a variable for which a
subrange is specified.
• An attempt was made to write an unde-
fined value to an enumeration variable.
7-88 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
7-7 Variable Data Types
This section provides the data types of variables that can be used with CIP message communications.
7-7-1 Data Type Codes
The following codes are given to variable data types.
Data Type Code (hex) Group*1
Boolean (bit) C1 CIP Common
SINT (1-byte signed binary) C2 CIP Common
INT (1-word signed binary) C3 CIP Common
DINT (2-word signed binary) C4 CIP Common
LINT (4-word signed binary) C5 CIP Common
USINT (1-byte unsigned binary) C6 CIP Common
UINT (1-word unsigned binary) C7 CIP Common
UDINT (2-word unsigned binary) C8 CIP Common
ULINT (4-word unsigned binary) C9 CIP Common
REAL (2-word floating point) CA CIP Common
LREAL (4-word floating point) CB CIP Common
STRING D0 CIP Common
BYTE (1-byte hexadecimal) D1 CIP Common
WORD (1-word hexadecimal) D2 CIP Common
DWORD (2-word hexadecimal) D3 CIP Common
TIME ( 8-byte data) DB CIP Common
LWORD (4-word hexadecimal) D4 CIP Common
Abbreviated STRUCT A0 CIP Common
STRUCT A2 CIP Common
ARRAY A3 CIP Common
UINT BCD (1-word unsigned BCD) 04 Vendor Specific
UDINT BCD (2-word unsigned BCD) 05 Vendor Specific
ULINT BCD (4-word unsigned BCD) 06 Vendor Specific
ENUM 07 Vendor Specific
DATE_NSEC 08 Vendor Specific
TIME_NSEC 09 Vendor Specific
DATE_AND_TIME_NSEC 0A Vendor Specific
TIME_OF_DAY_NSEC 0B Vendor Specific
Union 0C Vendor Specific
*1. “CIP Common” indicates codes that are defined in the CIP Common Specifications. “Vendor Specific” indi-
cates codes that are assigned by OMRON.
7-7-2 Common Format
The basic format on the data line is shown below.
Data Format
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-89
7-7
Variable
Data
Types
7
7-7-1
Data
Type
Codes
7 CIP Message Communications
USINT Data Type Refer to Data Type Codes on page 8-43 for specific values.
USINT AddInfo Length Additional information: Field length in bytes
(AddInfo) Additional information: CRC value of structure or other
UINT Num of Element (L) information
(H) This field exists only in the parameters for the variable
write service.
Actual data
7-7-3 Elementary Data Types
Fixed-length Byte Data
Applicable data types: BYTE, USINT, and SINT
Data Format
USINT Data Type
USINT 00h
UINT Num of Elem (L) 01 hex
(H) 00 hex
USINT Data
Fixed-length 2-byte Data
Applicable data types: INT, UINT, UINT BCD, and WORD
Data Format
USINT Data Type
USINT 00h
UINT Num of Elem (L) 01 hex
(H) 00 hex
Data (L)
(H)
Fixed-length 4-byte Data
Applicable data types: DINT, UDINT, UDINT BCD, REAL, and DWORD
Data Format
USINT Data Type
USINT 00h
UINT Num of Elem (L) 01 hex
(H) 00 hex
Data (LL)
(LH)
(HL)
(HH)
7-90 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
Fixed-length 8-byte Data
Applicable data types: LINT, ULINT, ULINT BCD, LREAL, and LWORD
Data Format
USINT Data Type
USINT 00 hex
UINT Num of Elem (L) 01 hex
(H) 00 hex
Data (Least-significant byte)
:
:
:
:
:
:
(Most-significant byte)
Boolean Data
Data Format
USINT Data Type C1 hex
USINT 00 hex
UINT Num of Elem (L) 01 hex
(H) 00 hex
USINT Status 01 hex: TRUE, 00 hex : FALSE
USINT Forced set/reset information* 01 hex: Forced, 00 hex: Not forced
*1. Specify 0 when writing data.
7-7-4 Derived Data Types
Arrays and structures are handled as derived data types.
Accessing One Member
The data format for accessing one element of an array or one member of a structure is the same as
the data format for the corresponding elementary data type.
Example: If you specify Var[5] to access a variable defined with UINT Var[10], use the same data for-
mat as for UINT data.
Accessing More Than One Element at the Same Time
 Arrays
• Accessing an Entire Array
If you access an array variable without specifying an element, the entire array is accessed.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-91
7-7
Variable
Data
Types
7
7-7-4
Derived
Data
Types
7 CIP Message Communications
The following data format is used.
Data Format
USINT Data Type Data type of array elements (D0 hex is not used.)
USINT 00 hex
UINT Num of Elem (L) Gives the number of elements in the array.
(H)
Data The actual data for the elements of the array are
: given in order in the same format as when the
elements are accessed individually.
Data
• Handling Multi-dimensional Array
Elements for a multi-dimensional array are given in order from the deepest elements.
For example, the data is read in the following format when Var is specified for a variable defined
with UINT Var[2][2].
Data Format
USINT C7 hex Data type code for UINT
USINT 00 hex
UINT Value of Var[0][0] (L)
(H)
UINT Value of Var[0][1] (L)
(H)
UINT Value of Var[1][0] (L)
(H)
UINT Value of Var[1][1] (L)
(H)
The following data format is used for a BOOL array (using BOOL b[2][3] as an example).
Data Format
USINT C1 hex (data type code for BOOL)
USINT 00 hex
(WORD) rsv rsv b[1][2] b[1][1] b[1][0] b[0][2] b[0][1] b[0][0]
rsv rsv rsv rsv rsv rsv rsv rsv
• Exceptions When Specifying the Num of Element Field
The following data format is used if a specification is made in the Num of Element field for a
BOOL array. (Refer to 7-4-5 Specifying Variable Names in Request Paths on page 7-44 for infor-
mation on the Num of Element field.) The status (TRUE/FALSE) is given in order for each ele-
ment of the BOOL variable.
Data Format
7-92 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
7 CIP Message Communications
USINT Data Type C1 hex
USINT 00 hex
UINT Num of Elem (L) Gives the number of elements in the array.
(H)
USINT Status 01 hex: TRUE, 00 hex: FALSE
: :
USINT Status
 Structure Variables
• Accessing an Entire Structure
If a structure variable is specified, it is treated as an access request for all of the members of the
structure.
Data Format
USINT Data Type A0 hex (Abbreviated STRUCT)
USINT 02 hex
UINT CRC (L) CRC value for the structure definition
(H)
UINT Num of Elem (L) 01 hex
(H) 00 hex
:
Data
:
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 7-93
7-7
Variable
Data
Types
7
7-7-4
Derived
Data
Types
7 CIP Message Communications
7-94 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
8
Socket Service
8-1 Basic Knowledge on Socket Communications...........................................8-2
8-1-1 Sockets............................................................................................................8-2
8-1-2 Port Numbers for Socket Services..................................................................8-2
8-2 Basic Knowledge on Protocols....................................................................8-3
8-2-1 Differences between TCP and UDP................................................................8-3
8-2-2 Fragmenting of Send Data..............................................................................8-4
8-2-3 Data Receive Processing................................................................................8-6
8-2-4 Broadcasting...................................................................................................8-9
8-3 Overview of Built-in EtherNet/IP Port Socket Services............................8-10
8-3-1 Overview.......................................................................................................8-10
8-3-2 Procedure......................................................................................................8-10
8-4 Settings Required for the Socket Services................................................8-12
8-5 Socket Service Instructions........................................................................8-13
8-6 Details on Using the Socket Services........................................................8-14
8-6-1 Using the Socket Services............................................................................8-14
8-6-2 Procedure to Use Socket Services................................................................8-14
8-6-3 Timing Chart for Output Variables Used in Communications........................8-16
8-6-4 UDP Sample Programming...........................................................................8-18
8-6-5 TCP Sample Programming...........................................................................8-23
8-7 Precautions in Using Socket Services.......................................................8-31
8-7-1 Precautions for UDP and TCP Socket Services............................................8-31
8-7-2 Precautions for UDP Socket Services...........................................................8-31
8-7-3 Precautions for TCP Socket Services...........................................................8-31
8-8 TCP/UDP Message Service.........................................................................8-33
8-8-1 Outline of TCP/UDP Message Service..........................................................8-33
8-8-2 Specifications of TCP/UDP Message Service...............................................8-33
8-8-3 Settings Required for TCP/UDP Message Service.......................................8-33
8-8-4 Command Format Specifications..................................................................8-34
8-9 Secure Socket Services...............................................................................8-36
8-9-1 Overview of Secure Socket Communications...............................................8-36
8-9-2 System Configuration of Secure Socket Services.........................................8-38
8-9-3 Procedure to Use Secure Socket Setting Function of the Sysmac Studio....8-39
8-9-4 Executing Instructions for Secure Socket Communications..........................8-47
8-9-5 Troubleshooting Errors in Secure Socket Communications..........................8-51
8-9-6 Secure Socket Communications Logging.....................................................8-51
8-9-7 Handling of Secure Socket Communications Setting Information.................8-54
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 8-1
8
8 Socket Service
8-1 Basic Knowledge on Socket Commu-
nications
8-1-1 Sockets
A socket is an interface that allows you to directly use TCP or UDP functions from the user program.
On a host computer (e.g., personal computer), sockets are provided in the form of a C language inter-
face library. If you load the library, you can program communications via TCP and UDP in the user
program.
On a UNIX computer, a socket interface is provided in the format of system calls.
With a built-in EtherNet/IP port, you can execute instructions in the user program by using sockets.
Through the communications services with sockets, you can send and receive data to and from re-
mote nodes, i.e., between the host computer and Controllers or between Controllers.
Built-in EtherNet/IP ports support UDP socket service as well as TCP socket service.
8-1-2 Port Numbers for Socket Services
Ports 0 to 1023 to be used for TCP/IP are reserved as well-known ports. In addition, ports 1024 to
49151 are reserved as registered ports by the protocols that are used.
Therefore, we recommend that you use port numbers 49152 to 65535 for applications other than the
protocols that are registered with the socket service.
You cannot specify port number 0 for the built-in EtherNet/IP port.
Furthermore, the built-in EtherNet/IP port uses TCP/UDP ports for some applications, therefore make
sure to avoid those ports when you set ports. Refer to A-12 TCP/ UDP Port Numbers Used for the
Built-in EtherNet/IP Port on page A-95 for details on the TCP/UDP port numbers that are used by the
built-in EtherNet/IP ports.
8-2 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
8 Socket Service
8-2 Basic Knowledge on Protocols
8-2-1 Differences between TCP and UDP
The TCP and UDP functions used on socket services differ as shown below.
TCP Communications
The following operations are performed each time data is sent to ensure that it reaches the destination
node.
The destination node returns an acknowledgment (ACK) when data is received normally.
The sending node sends the next data after ACK is returned. It resends the same data if ACK is not
received within a certain length of time.
Send data
Send Receive
request Acknowledgement (ACK) request
Resend data
Sending node If ACK is not returned Destination node
In TCP, the remote IP address and the remote TCP port number are specified when a request is made
to open a socket. The variables that store the data to send are specified when the send request is
made.
UDP Communications
Data is simply sent to the destination node, and neither acknowledgment nor resends are performed
like they are for TCP.
To increase the reliability of communications, some user application must be used to perform data re-
send processing.
Send data
Send
Receive
request Acknowledgement (ACK) request
(When ACK processing is performed by user application)
Sending node Destination node
In UDP, the remote IP address and the remote UDP port number are not specified when a request is
made to open a socket. The variables that store the remote IP address, the remote UDP port number,
and the data to send are specified when the send request is made.
(The send data includes information on the IP address and UDP port number of the sending node.)
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 8-3
8-2
Basic
Knowledge
on
Protocols
8
8-2-1
Differences
between
TCP
and
UDP
8 Socket Service
Furthermore, once a socket is opened in UDP, communications with other remote nodes is possible
without closing the socket.
TCP Communications Procedure
You execute socket communications instructions in sequence to perform TCP communications for the
built-in EtherNet/IP port.
Client Server
Socket
Bind
SktTCPAccept Instruction
Socket Listen
• Execution of Socket Functions
SktTCPConnect Instruction Accept Socket(), Bind(), Listen(), and
Connect SYN
• Execution of the Socket Function Accept()
Connect() • Timeout monitoring until Connect is
The connection is established by SYN ACK completed
the normal completion of the Instruction The connection is established by the
SktTCPConnect instruction. completed. normal completion of the SktTCPAc-
cept instruction.
ACK Instruction
completed.
SktSetOption Instruction
Setopt
• Execution of the Socket Function
setsoketopt()
SktSetOption Instruction
The option for TCP socket is set
• Execution of the Socket Function
by the normal completion of the Setopt
setsoketopt()
SktSetOption instruction. (Note)
The option for TCP socket is set
by the normal completion of the
SktSetOption instruction. (Note)
SktTCPSend Instruction
Send
• Execution of the Socket Function
Send() Recv SktTCPRcv Instruction
The data is stored in the send • Execution of Socket Function Recv()
buffer by the normal completion of Instruction • Timeout monitoring until data is
the SktTCPSend instruction. completed. received from the remote node
ACK
Writing the received data to the variable
is completed by the normal completion
of the SktTCPRcv instruction.
SktClose Instruction Close
• Execution of the Socket Function FIN
Close()
The acknowledgment (ACK) of Socket interface
FIN from the remote node is
received by the normal comple- ACK Packets sent by the TCP/IP layer
tion of the SktClose instruction.
Packets sent by higher layers
However, RST (not FIN) is sent if Instruction
the Linger Option is specified. completed.
NoteSet the socket option as required. Refer to the NJ/NX-series Instructions Reference Manual (Cat. No.
W502) for the socket option.
8-2-2 Fragmenting of Send Data
The receive buffer for the built-in EtherNet/IP port is a maximum of 9,000 bytes per socket handle. If
any data that is larger than 9,000 bytes is received, the data is discarded.
8-4 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
8 Socket Service
Up to 2,000 bytes can be received for a single request. In this case, the data is sent in fragments as
described below.
Using TCP
The following figure shows what occurs when data is sent in fragments in TCP communications.


Question: A send request is sent from the user program at the sending node. It specifies a variable with a

Answer: data length of 2,000 bytes.


Question: The built-in EtherNet/IP port separates the send data into 1,024 bytes as data A and 976 bytes as

Answer: data B.


Question: After data A is received, the remaining data B is received.

Answer:
Sending node (Controller) Receiving node (host computer)
User program Built-in Receiving node User program
EtherNet/IP port
Ethernet line
(4) Receive request
(1) Send request (2) Fragmenting (3)
Data A and
data B are
2,000 bytes 1,024 bytes 2,000 bytes
sent in
succession.
Original data Data A Data A Data A
1,024 bytes
(5) Receives remaining 976 bytes.
2,000 bytes
Data B Data B Data B
976 bytes 976 bytes
(6) Receive request
(request for 2,000 bytes)
Data is delivered to the user program in a fragmented form in TCP communications, as shown
above.
The size of received data must be checked to confirm that all the data was received before the
next receive request is made. (You can use the RecvSize output variable of the socket receive
request instruction to check the received data.)
Additional Information
If TCP is used to send data to a different segment, the data is separated into 536-byte frag-
ments.
Using UDP
The following figure shows what occurs when data is sent in fragments in UDP communications.


Question: A send request is sent from the user program at the sending node. It specifies a variable with a

Answer:
data length of 2,000 bytes.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 8-5
8-2
Basic
Knowledge
on
Protocols
8
8-2-2
Fragmenting
of
Send
Data
8 Socket Service


Question: The built-in EtherNet/IP port separates the send data into 1,472 bytes as data A and 528 bytes as

Answer: data B.


Question: Data A and data B are joined and restored as the original send data, and the data is passed to the

Answer:
user program.
Sending node (Controller) Receiving node (host computer)
User program Built-in Receiving node User program
EtherNet/IP port
Ethernet line
(1) Send request (2) Fragmenting (3)
Data A and
data B are
2,000 bytes 1,472 bytes
separated
and sent.
Original data Data A
(4) Receive request
2,000 bytes
Data B Data A Data B
528 bytes
Since UDP communications are performed in datagram units as shown above, send data is re-
stored in the original data format before it is passed to the user program.
8-2-3 Data Receive Processing
This section describes data receive processing for TCP and UDP.
TCP Receive Processing
In TCP communications, receive data stored in the receive buffer (a maximum of 9,000 bytes) can be
divided to be received.
Thus, if received data is larger than the maximum size of data that can be received with one data re-
quest (2,000 bytes), more than one receive request can be sent to receive all of the data.
If the data in the receive buffer is smaller than the size of the variable specified by the receive request,
the entire receive data is received.
Example) Receiving 3,000 Bytes of Receive Data in Two Sections


Question: The data is divided to be sent in two sends from the sending node, and is stored in the receive

Answer: buffer.


Question: More than one receive request is used to receive all of the send data.

Answer:
8-6 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
8 Socket Service
Sending node (host computer) Receiving node (Controller)
User program Built-in EtherNet/IP port User program
(1) Data received to
Ethernet line receive buffer. (2) The data is received in
two sections.
Receive buffer
(9,000 bytes)
1st send 1st receive request
request (Request for 1,000 bytes)
1,000 bytes Data A Data A
Data A 1,000 bytes
2,000 bytes Data B Data B
2nd send
request
2nd receive request
3,000 bytes (request for 2,000 bytes)
Data B 2,000 bytes
UDP Receive Processing
In UDP communications, receive data stored in the receive buffer (a maximum of 9,000 bytes) cannot
be divided to be received.
Therefore, if data is sent for one send request, it must be received with one receive request.
The following must be considered to receive data at the receiving node.
• When the Size of the Variable Specified in the Receive Request Is Smaller Than the Data Sent with
the Send Request
If receive data exceeds the size of the variable specified in the receive request, the excess of the
data is discarded.
If the data in the receive buffer is smaller than the size of the variable specified in the receive re-
quest, the entire receive data is received.
Example 1: 1,000-Byte Receive Request Is Made for 2,000-Byte Data


Question: The data is divided to be sent in two sends from the sending node, and is stored in the receive

Answer: buffer.


Question: If a 1,000-byte receive request is made for the first send, the remaining 1,000 bytes of the data is

Answer: discarded.


Question: If the next receive request is made for 2,000 bytes, the data for the second send is all received.

Answer:
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 8-7
8-2
Basic
Knowledge
on
Protocols
8
8-2-3
Data
Receive
Processing
8 Socket Service
Sending node (host computer) Receiving node (Controller)
User program Built-in EtherNet/IP port User program
(1) Data received to
Ethernet line
receive buffer.
(2) 1st receive
Receive buffer request (request
(9,000 bytes) for 1,000 bytes)
1st send
request Data A (upper bytes) Data A (upper bytes) 1,000 bytes
2,000 bytes Data A
Data A (lower bytes)
The remaining
2,000 bytes Data B Data B data is discarded.
2nd send
Data A (lower bytes) 1,000 bytes
request
4,000 bytes (3) 2nd receive
request (request
for 2,000 bytes)
Data B 2,000 bytes
• When Only One Receive Request Is Made for Data Sent for Multiple Send Requests
If data is sent for multiple sent requests, you cannot receive the entire data with one receive request
regardless of the size of the data.
Example 2: 1,000-Byte Receive Request Is Made for 200-Byte Data Sent for Two Send Requests


Question: The data is divided to be sent in two sends from the sending node, and is stored in the receive

Answer: buffer.


Question: Even if a receive request is made for 2,000 bytes, only 100 bytes of the data is received as re-

Answer:
quested with the first send request.
Sending node (host computer) Receiving node (Controller)
User program Built-in EtherNet/IP port User program
(1) Data received to
Ethernet line
receive buffer.
(2) 1st receive request
Receive buffer (request for 1,000
(9,000 bytes) bytes)
1st send
request
100 bytes Data A Data A Data A
100 bytes Data B Data B 100 bytes
2nd send
request You can receive the rest
of the data with another
200 bytes
receive request.
Data B
8-8 NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
8 Socket Service
8-2-4 Broadcasting
If you specify a broadcast address as the destination IP address for a UDP socket, data can be broad-
cast to all nodes on the network to which the host for the EtherNet/IP port belongs.
If there is a router on the network, packets are not sent beyond the router.
You can broadcast up to 1,472 bytes of data. Data larger than the maximum size cannot be broadcast.
You can specify either of the two following types of broadcast addresses.
• Local Broadcast
If no destination IP address is specified, the following IP address is specified automatically.
Network segment: The network segment of the local IP address is set.
Host segment: All bits are set to 1.
• Global Broadcast
Specify this type when the IP address of the local node or the subnet to which the local node be-
longs is unknown.
As shown below, every bit of the 32-bit address is set to 1.


Answer:
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506) 8-9
8-2
Basic
Knowledge
on
Protocols
8
8-2-4
Broadcasting
8 Socket Service
8-3 Overview of Built-in EtherNet/IP Port
Socket Services
8-3-1 Overview
Socket services on the built-in EtherNet/IP port are used to exchange data between Controllers and
general-purpose applications that do not support CIP message communications.
The Controller requests the socket service from the user program.
General purpose (non-CIP communications) application
Intranet
At the host, system calls of sockets, e.g.,
from a C language interface library, can
be used to directly use TCP/IP or UDP/IP
to access Controller data.
Ethernet
Built-in EtherNet/IP port
Data
At the Controller, socket instructions can
be executed in the user program to
directly use UDP or TCP to exchange
data with the host computer.
Overview of Socket Services with Socket Service Instructions
You can use socket services by executing socket service instructions.
The maximum total number of UDP and TCP sockets that you can use is given in the following table.
Maximum number of sockets
NX-series CPU Unit NJ-series CPU Unit
UDP/TCP
Other than the Unit version Unit version
NX502 NX102
left. 1.00 to 1.02 1.03 or later
UDP socket Total of 60 sock- Total of 60 sock- Total of 30 sock- Total of 16 sock- Total of 30 sock-
service ets ets ets ets ets
TCP socket
service
Secure socket Not supported
service*1
*1. An NX102-££00 CPU Unit with unit version 1.46 or later or an NX102-££20 CPU Unit with unit version