Using CIP to Read/Write Network Variables with NJ/NX

Updated April 13, 2023

Delete

Info

Ensure that the device you are communicating with supports CIP. Not all devices with an Ethernet port support it. All devices that support Ethernet/IP support CIP, and there are also some devices that do support CIP but not Ethernet/IP.

What is CIP?

CIP (Common Industrial Protocol) is a communication protocol widely used in industrial automation to connect different devices. Among its messaging options, CIP explicit messaging enables real-time data exchange between devices. Using CIP explicit messaging with Omron NX and NJ PLCs allows for seamless integration with other CIP-enabled devices, ensuring reliable and fast data exchange for real-time system control.

CIP explicit messaging allows devices to send and receive messages in a predetermined format, providing a reliable and efficient means of transmitting critical information. Its flexibility supports different data types and provides real-time communication, making it an essential tool in industrial automation and control systems. By leveraging CIP explicit messaging, Omron NX and NJ PLCs can communicate effectively with other CIP-enabled devices, allowing for reliable and efficient system control.

There are two major types of CIP connection that you can make.

Connected Message Connection

A CIP (Common Industrial Protocol) type 3 explicit connection is a type of communication connection used in industrial automation and control systems. It is a point-to-point connection between two devices, where the devices exchange messages in a predefined format. This type of connection is typically used for real-time data exchange between devices, such as sending control commands and receiving status updates. You may use this type of connection to send one off messages, but it is not its intended purpose.


Unconnected Message Connection

UCMM (Unconnected Message Manager) explicit messages, on the other hand, are a connectionless method, meaning that devices do not need to establish a connection before exchanging messages. In this method, the sending device sends a message to the network with the intended recipient's address, and the network forwards the message to the recipient device. This type of connection is typically used for non-real-time data exchange, such as configuration data, alarm notifications, and diagnostics.

1. Configure the Server

A CIP server is a device or software component that provides data and services to other devices on the network. It receives and processes messages from client devices, responding with the requested information or performing the requested action. 

  1. Set the Server network settings. Ensure that the server is on the same subnet as the client.
  2. Ensure the CIP server is enabled - this should be the default configuration.
  3. Create variables in the Global Variable Table that you wish to share and set the Network Publish attribute to "Input" and "Output". In this example we will read and write two Integer type variables, but this can be scaled using arrays.


Delete

2. Configure the Client

A CIP client is a device or software component that initiates communication with a CIP server to request data or services. The client sends a message to the server and waits for a response, in order to access data and services.

  1. Set the Client network settings to match the Server.
  2. Create local variables that can read/write to the server
Delete

3a. Ladder Code (Connected Message)

  1. Determine the route path. See the following article for more information.
    https://omron.helpjuice.com/en_US/how-to-determine-the-route-path-for-nxnj-plcs
  2. On the client, connect to the server, enter the route path as a string.
  3. Read or write the target variables. Enter the variable names as a string. Use the handle generated by the CIPOpen FB.
    Delete

    Info

    The input "Size" for the CIP blocks is determined by the size of the array that is being read from or written to. If the value for "Size" is left blank, it will default to one element. However, when sending more than one element, the "Size" input must equal the length of the array.

Delete

3b. Ladder Code (Unconnected Message)

  1. Determine the route path. See the following article for more information.
    https://omron.helpjuice.com/en_US/how-to-determine-the-route-path-for-nxnj-plcs
  2. Read or write the target variable. Enter the route path as a string to the read and write FBs. 
    Delete

    Info

    The input "Size" for the CIP blocks is determined by the size of the array that is being read from or written to. If the value for "Size" is left blank, it will default to one element. However, when sending more than one element, the "Size" input must equal the length of the array.

Example Programs

CIP Client

CIP Server

Delete


Start a Conversation
This conversation is closed
Uploading...