Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Products
  • Automation Systems
  • Programmable Logic Controllers (PLC)

CS/CJ to NJ/NX CIP Variable Read/Write Function Blocks

Written by Arlo D'Cruz

Updated at October 17th, 2024

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Products
    Automation Systems Control Components Motion & Drives Quality control & Inspection Robotics Safety Sensing Services Software Switching Components
  • Amplify e-Store
    e-Store public
  • Public CSC
+ More

Introduction

This article is a brief introduction into the usage of the CIP variable read write function blocks for the CJ2 or CS series PLC. 

Information

These are custom function blocks and have not gone through the same validation process as the built in functions for the CS/CJ series . 

 

 

CIPNXVarMaker

An optional ‘helper’ Function Block (FB) to create variable names with or without array offsets for use with the CipVariableRead and CipVariableWrite FB’s .
The CipNxVarMaker FB is designed to be used in one of two options – with external base names provided or using an internal base name.
• Option 1
When using external names - a ‘base’ variable name should be already defined (elsewhere). UseExtStringByRef = TRUE
• Option 2
When using internal names – the FB should be edited by the user. This may mean multiple copies of FB source if different variable names are required (hence Option 1 recommended). UseExtStringByRef = FALSE

CIPVariableWrite

Function Block (FB) to ‘Write’ (send) a single item or block of data from an Omron CJ/CS PLC to a Sysmac NJ/NX Controller via in-built Ethernet/IP (EIP)
port. It enables writing from CJ/CS memory (CIO/DM, etc.) to Sysmac Network Published Variables.

The operation is like the PLC ladder SEND instruction but using Common Industrial Protocol (CIP) variable access rather than Omron FINS protocol. This means that a remote Sysmac CPU can be accessed by IP address only and no FINS addresses need be set (FINS Networks and FINS Nodes).
The FB is written in Structured Text and can be used on CJ or CS CPU’s (V4) with addition of EIP port. These FB’s will ONLY work by accessing Sysmac CPU EIP ports (i.e. not NJ CPU+CJ1W-EIP21 unit).
It can only be used with Ethernet/IP units (EIP). At time of writing this refers to CS1W-EIP21 (V2 & V3), CJ1W-EIP21 (V2 & V3), CJ2H-CPU6x-EIP and CJ2M- CPU3x.

Setup

1. Configure the inputs and outputs of the block as per below.

2. Configure variables on the global variable table of the NX/NJ as "Publish Only".

The below example shows how you might write to a variable of type WORD called “WdSingle”.

The below example shows how you might write 10 elements to a Integer array named IntAryIn starting at index 2.

 
 

CipVariableRead

A Function Block (FB) to ‘Read’ (recv) a single item or block (array) of data from an Omron Sysmac NJ/NX Controller Network Published Variables via in-built
Ethernet/IP (EIP) port to CJ/CS PLC memory (CIO/DM, etc.).

The operation is like the PLC ladder RECV instruction but using Common Industrial Protocol (CIP) variable access rather than Omron FINS protocol. This means that a remote Sysmac CPU can be accessed by IP address only and no FINS addresses need be set (FINS Networks and FINS Nodes).
The FB is written in Structured Text and can be used on CJ or CS CPU’s (V4) with addition of EIP port. These FB’s will ONLY work by accessing Sysmac CPU EIP ports (i.e. not NJ CPU+CJ1W-EIP21 unit). It can only be used with Ethernet/IP units (EIP). At time of writing this refers to CS1W-EIP21 (V2 & V3), CJ1W-EIP21 (V2 & V3), CJ2H-CPU6x-EIP and CJ2M- CPU3x.

Setup

1. Configure the function block as per below

2. Configure variables on the global variable table of the NX/NJ as "Publish Only".

The below example shows how you might read from a variable of type WORD called “WdSingle”.

The below example shows how you might read 10 elements from a Integer array named IntAryIn starting at index 2.

 
 

Example Program

An example program and the function blocks may be downloaded here.

explicit messaging cip function

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Using CIP to Read/Write Network Variables with NJ/NX
  • NX/NJ to CompactLogix using CIP Explicit Messages
  • How to teach Multiple Robots Conveyor Tracking Pallet Process using ACE Versions lower than 3.8.3.160.
  • What is BCD?

Definition by Author

0
0
Expand