日本語 English

CIP Message Communication (UCMM)

Notes

The explanations and samples here are based on the user's manual for the "NJ/NX-series CPU Unit Built-in EtherNet/IP Port" (SBCD-377?) and on analysis of messages actually exchanged by CX-Compolet
They include content not described in the EtherNet/IP user's manual, and some parts of the messages are unclear, so treat this as a way to get a feel for the CIP message communication protocol
The application downloadable here can read and write variables, but use it only for testing


For production CIP message communication, use CX-Compolet
OMRON CX-Compolet
CX-Compolet explanation page

Overview

A PC can read and write memory values by sending CIP (Common Industrial Protocol) commands via Ethernet to devices such as PLCs on the network
Here, PLC memory values are read using UCMM, one of the two kinds of CIP message communication, CLASS3 and UCMM
CIP message communication has Connected Messaging (Class 3) and Unconnected Messaging (UCMM). This page explains how to access PLC variables using UCMM.


The steps for reading variable values with the following configuration are explained here
Configuration diagram for CIP UCMM communication from a PC to an OMRON NJ/NX PLC

UCMM message flow

UCMM communication sequence diagram After connecting via TCP/IP
Send the ListService command to prepare to start the IP connection (command code in parentheses)
Next, send the RegisterSession command to get a handle (Session Handle)
This handle is used in subsequent SendRRData
Set a variable read or write command in the Service of SendRRData and send it
Send UnRegisterSession to finish
  1. TCP connection
  2. ListService
  3. RegisterSession
  4. SendRRData
  5. UnRegisterSession

Message format

Basic format
NameByte count
Encapsulation Header
Command2
Length2
SessionHandle4
Status4
Sender8
Options4
Command Specific Data
CommandVariable length
Set ListService, RegisterSession, SendRRData or UnRegisterSession in the Command of the encapsulation header and send

NOTE
Data is set in little endian

Send/receive data for each command

ListService

Send data
NameByte countData
Encapsulation Header
Command20x0004 (ListService)
Length20
SessionHandle40x00000000
Status40x00000000
Sender Context80x0000000000000000
Options40x00000000
Command Specific Data is not needed
Example of received data
NameByte countData
Encapsulation Header
Command20x0004
Length226
SessionHandle40x00000000
Status40x00000000
Sender Context80x0000000000000000
Options40x00000000
Command Specific Data
Item Count21
Item1Type ID20x0100 = List Service Response
length220
Capability Flags20x0120
5bit=Support CIP Encapsulation
8bit=Supports CIP Class 0 or 1
Name of Service16"Communications",0x0000

RegisterSession

Send data
NameByte countData
Encapsulation Header
Command20x0065 (RegisterSession)
Length24
SessionHandle40x00000000
Status40x00000000
Sender Context80x0000000000000000
Options40x0000000000
Command Specific Data
Protocol Version2 1
Option Flags20x0000
Example of received data
NameByte countData
Encapsulation Header
Command20x0065
Length24
SessionHandle40x0001016d
Contains the handle
Status40x00000000
Sender Context80x0000000000000000
Options40x0000000000
Command Specific Data
Protocol Version21
Option Flags20x0000

SendRRData

Send data
NameByte countData
Encapsulation Header
Command20x006f (SendRRData)
Length230
SessionHandle40x0001016d
Status40x00000000
Sender Context80x0100000000000000
Options40x0000000000
Command Specific Data
Interface Handle40x00000000
Timeout20x0000
Item Count22
Item1Type ID20x0000 (Null Address Item)
length20
Item2Type ID20x00b2 (Unconnected Data Item)
length214
Common Industrial Protocol
Service Code10x4c
Request Path Length15 (word)
Request Path100x9107+"testInt"+0x00
(padded with 0 for an odd number of bytes)
CIP Class Generic
Request Service Data20x0100
Example of received data
NameByte countData
Encapsulation Header
Command20x006f (SendRRData)
Length224
SessionHandle40x0001016d
Status40x00000000
Sender Context80x0100000000000000
Options40x0000000000
Command Specific Data
Interface Handle40x00000000
Timeout20
Item Count22
Item1Type ID2 0x0000 (Null Address Item)
length20
Item2 Type ID20x00b2 (Unconnected Data Item)
length28
Common Industrial Protocol
Service10xcc (MSB ON + 0x4c)
(Fixed)10x00
StatusGeneral Status10x00
Additional Status10x00
CIP Class Generic
Response Service Data
Data Type10xc3
AddInfoLength10x00
Data20x3412

UnregisterSession

Send data
NameByte countData
Encapsulation Header
Command20x0066 (UnregisterSession)
Length20
SessionHandle40x0001016d
Set the handle to disconnect
Status40x00000000
Sender Context80x0000000000000000
Options40x0000000000
Command Specific Data is not needed

There is no received data

Related pages

FAQ

What is UCMM?

UCMM (Unconnected Messaging) is unconnected CIP message communication used in EtherNet/IP. Unlike Connected Messaging (Class 3), which establishes a connection in advance, it sends messages only when needed to access PLC variables.

What is the basic procedure for CIP message communication?

After the TCP connection, send messages in the order ListService, RegisterSession, SendRRData, UnRegisterSession. The Session Handle obtained with RegisterSession is used in SendRRData.

What does SendRRData do?

SendRRData is the command that sends the actual CIP service in UCMM communication. It carries CIP commands such as Read Tag Service and Write Tag Service to the PLC.

What is a Session Handle?

The Session Handle is an identifier obtained in the response to RegisterSession. It is used in subsequent SendRRData and UnRegisterSession to identify the communication session.

Applications

TCP and UDP communication test tool

Analyze and test TCP and UDP communication

ComCom

An application that sends messages you create using Ethernet socket communication

CIP communication analysis tool

Analyze and test EtherNet/IP / CIP communication

CipMes

An application that sends CIP messages using Ethernet socket communication

Comments