How to Setup Ethernet IP Explicit Messaging to Gather Data in Omron Machine Automation Controller

Hello everyone, today I will illustrate how to set up explicit messaging in Ethernet IP using CIP function blocks to gather data from CJ2M-CPU33 and NX1P2 PLC to any machine automation controller, NJ or NX series PLC.

I am Tom Trinh, Senior Application Engineer for Valin Corporation. Let's get started.

So here's my layout for the example I'm going to go through today. I have the machine automation controller, NJ501-1300 with Ethernet IP 192.168.250.3. And this PLC is basically will collect the data from the CJ2M-CPU33 PLC with the IP address of 192.168.250.5, and another NX1P2 PLC  with address IP address of 192.168.250.1. I have all these three PLC’s connected to a Ethernet switch, W4S1, and I'm using Omron Sysmac Studio software to set up these CIP function blocks.

So first and foremost, here's the function block that you would need to set up. So right now I'm on my master PLC which is NJ501-1300 and in there I'm using the function block called CIPUCMM Read. To set up this function block, I have the root path and in the root path, since I'm using the CPU port of the NJ so the root path would be 02\192.168.250.5 because that's the CJ2M PLC IP address. And you want to have \01\#00. 1 means internal backplane port and zero means CJ2M PLC. The time out I set up as 10 seconds. If there's no response then it times out. The source data, the tag name is FromCJ_CIP_Node5, and that basically A tag name is actually a structure in the CJ2M PLC. And the size is basically one structure and the destination data is FromCJ_CIP_Node5. So this is the tag name in my NJ 501. So let's take a look at that real quick. OK, so let me show you my CJ real quick. So if you look into CJ here in the symbol table I have this FromCJ_CIP_Node5 and that is matching what I have for source data. And in here as you can see, the data type is the structure that I created or defined. And let's take a look at that. And under data type, here's what I have because if you look at the symbol I have structure sFromCJRead.  And if I look over here sFromCJRead the member inside the structure as employee with the data type integer.  Machine, another member, Machine with the data type integer. Another member of Temperature_ PV with the data type real. Another member Pressure_ PV with data type real. Now if you look on my NJ side. Within this structure, FromCJ_CIP_Node5, I use structure sFromCJRead and that is right here. And you look at this structure and this structure they match. That is very important that these Members and the data type are matching. OK so that's how you set up tag. Let's go back to this real quick. So to set it up once again you have the root path, the timeout, the source data, the size and also destination. That's all you have to do.

To write the data from the NJ to the CJ2M. I used the CIPUCMMWrite. And in this function block, you once again need to put in the Routepath. This is similar to what I have up here. Timeout, structure the destination. The structure in the CJ. And in this example, I have ToCJ_CIPNode5. This is the structure and if I look at my CJ under the symbol type under symbol, I have ToCJ_CIPNode5 which match exactly what I have on this side at the destination data. And then I only want to write one structure. That's why the size is 1 and the source data is coming from my tag name called ToCJ_CIPNode5. And again if I look at this structure, this is from the structure sToNPLC. So if I do look at this. So here it is sToNPLC and these are the members inside the structure. And if I bring back my CJ, you will see that it's matching. So here we go. This structure is sToNPLC and I look deeper sToNPLC, you notice all the members here as well as the data type matching what we have over here. OK, so that's how you set up the structure to be able to receive the data as well as sending the data. Alright, let's get back to the program. So to read the data from CJ, I'm using CIPUCMMRead function block. To write the data from the NJ to the CJ2M, I'm using CIPUCMMWrite. So let's see how it works. So right now, I'm going to go online which already online for my data FromCJ_CIP_Node5.Temperature ,I have I'm going to change this date a little bit and then we'll see what happens. I'm going to have this as 55.53. For the pressure I'm going to have 5.90. The machine number, this is coming from machine #50. And the employee who's operating machine right now is 57. So that's the employee number.

As soon as I click my UCMM_CIP_Read here, you will see the data coming to here. Here we go. So now you can see that the data coming from the CJ is matching exactly what you have on the NJ now. So that's how you read it. Now to write it let me test it and show you how it works over here. So right now let's say my machine number is.  Let me change this to 57. Let's say I want to change the set point  to 105.45.  Pressure now it's going to be 7.8, so her is my CJ side. As soon as I execute this bit, the machine number, the temperature setpoint and pressure will be coming to CJ right here. So right now they are zero. I'm going to change. I'm going to trigger it now. And if I go back here so there's a data 57 for the machine number. 105.45, which is the set point and also the pressure will be 7.8 which matching exactly what I have here. So that's how you set up from NJ to CJ.

You use the same function blocks for any NX Machine Automation Controller, NX or NJ. So here I already created another two function block here. I also have NX1P here on this side, so let's say on this side I have to read the data from the NX1P. I created a structure NX102_CIP_DS_Out and that is here. So I have the data right now is 111 for the integer. The real is going to change it to. 1.23. A word is 1234. The bit is FALSE for bit zero and TRUE for bit one. As soon as I trigger this, the data from the NX1P2 will be coming into NJ3_CIP_DS_In which is here. So let me bring this back up and I'm going to execute this right now. Actually let me change it to different number because this is the old data that I have. So it's going to be 222. It is going to be 4444.4 and this is 5678 and this is TRUE and this is FALSE for bit zero and one and I'm going to click this one now. All the data is coming over from the NX1P2. Let's take a look again to make sure whether it's matching. Yep, everything here is matching exactly what you have here. So that's how you read from the NX or NJ PLC. Alright, so let's say I want to write some data from my master here. So let's say.  So here we go. Let me do this. So how do I write? I use the structure from my NJ which is NJ 3_CIP_DS_Out which is here.

OK, I'm going to write it to the NX1 P2 and the tag name in the NX1P2 is NX102_CIP_DS_In. So here's the data that you will see as soon as I execute the write bit here. But before I do that, these are some old data. As you can see, they are already matching. But I'm going to change it to a different number, so this will be 664 for the integer. The Real_1,  I'm going to make it 100.9. The word is FFFF. Remember, this is word so it can be hexadecimal. I’m going to change  to FALSE for bit zero and TRUE for bit one.  Now I'm going to execute this. Actually, I need to turn this one off 1st. I'm going to turn it on. OK. I have a look on my NX1P2. And here's the data. It's matching exactly what I wrote from my NJ501-1300. So that's how you set it up to collect the data as well as writing the data between the machine automation controller NJ or NX PLC to CJ series PLC as well as another NX or NJ PLC.

If you have any questions, please call (855) 737-4716 or fill out our online form.