How to Set Up Remote IO Over Modbus TCP on Mitsubishi FX5

Remote I/O allows PLC devices to send and receive digital and analog signals from devices which are not physically near the PLC, while drastically reducing wiring. Learn how to configure the Mitsubishi FX5 PLC to communicate with remote I/O units over Modbus TCP.

Equipment used:

Controller: Mitsubishi FX5U-32MR/ES

Remote I/O Block: WAGO 750-362, 750-602, 750-1506, 750-600

Software: Mitsubishi GX Works3


Today, we are going to be setting up remote IO on a Mitsubishi FX5U over Modbus TCP. Here’s my setup: on the left, I have my trusty FX5U CPU. It is connected to an Ethernet switch, to which is also connected my PC and this Wago Modbus TCP coupler. It has a power supply, an 8 input, 8 output remote card, and this endcap. For remote input, we’ll simply be using these two power switches, and for remote output, we’ll observe the output lights turn on and off.

Now, the FX5U CPU is going to act as the Modbus master, while the Wago remote IO will act as the Modbus slave. The cool thing about remote IO is, although I have these units here next to each other with a very short Ethernet cable, I could put this remote IO station anywhere in my facility. As long as it’s connected to the same network as my PLC, I can run those eight inputs and eight outputs and only have to run one wire. So, let’s get started.

Next, let’s open up GX Works 3 and start a new project on our FX5U. In order to set up the FX5U CPU as the master on our Modbus communication, we’re going to go into Parameter > FX5U CPU Module Parameter > Ethernet Port. Now, in our Basic Settings here, you can see Modbus TCP Settings. This is not what we want—this will allow us to set it up for slave communication, but we need to set it up as the master.

Go to Application Settings here on the left: Simple CPU Communication Setting. Here, we have the option to use or not to use Simple CPU communication. That is the question—we’re going to use it. Then, double-click on Detailed Setting. Here, we have the option to set up different communication options.

For our first one, we’re going to set up a read. You can leave the interval reading every 100 milliseconds—you can speed it up or slow it down. For the source, where do we want to read from? Well, we need to select the device type. Scroll all the way to the bottom here—we’re not using any of these; we’re using a Modbus TCP-compatible device. It can be any device as long as it’s compatible with Modbus TCP.

The IP address—I forgot to mention this—we are using the IP address of 192.168.3.11 for our Wago Modbus TCP coupler. Port number we leave at 502, but we need to select the port on our FX5U CPU that’s going to be doing this communication. A good rule of thumb is to use 1024 and up, so we’ll start this at 1024.

Now, scroll over. We can see the source of the read is from our Modbus TCP device. Destination—it’s copying it to our host station. This is our default IP address. Now, we need to select whether to read from a bit device or from a word device. In our case, we have discrete IO, so it’s going to be a bit device, and this is going to be an input.

We need to define the start and end of the Modbus address on the registers of the Modbus TCP device. You can find this information in the documentation for your Modbus device. Here, we can see that 0 through 255 are reserved for our inputs, and 512 and up are reserved for our outputs. So, we will begin with the input starting at 0.

The minimum you can read—if you try to just read one bit, it will tell you that you have to read 16 bits. That’s more than we have, anyway, so we’ll go ahead and read 15 points. For our destination, where do we want this information to be copied to on our PLC? You can use whatever you want, as long as it doesn’t conflict with something else that’s already in use.

If you try to use X0, this won’t work for you because those inputs are already reserved for the physical inputs on your FX5U CPU. So, we can start this from X100. We don’t need to define a word device because we’ve already defined a bit device. Here’s some settings over here—you can leave them at the default.

Next, we will need to set up our Write if we want to use the output of our remote IO. The output is coming from our host station and going to our Modbus TCP device. Let’s set that up. Again, device type: scroll to the bottom (Modbus TCP). The IP address of our station (which may be different for you)—our IP address is set to 192.168.3.11.

We need to use a different port number, or else we’re going to run into issues. So, we’re going to use 1025 since we used 1024 for the last one. Okay. Now, the source—since this is output, this is coming from our PLC. You need to choose the device that you want to copy this data from to send to your remote IO.

In this case, we use Y. To avoid conflicting, we’ll start it at Y100. We need to write a minimum of 16 bits—if you try to write Y101, again, it will not let you. We need to write 16 bits here. The destination: where is this going? This is going to go to a coil starting from… we can pull up our documentation—it was 512-527.

Everything looks good. Let’s go ahead and hit Check. We have “No error found,” so we can apply these settings. If you do not click Apply, this will not be saved. Then, simply transfer to the PLC—select All. Now, it’s telling us we need to reset the CPU. It wants to run it, so I’ll go ahead and do that. I’ll flip the switch on my FX5U CPU to Stop, reset, and back to Run.

Okay, now if we’ve done this correctly, we should be able to send data to our remote IO and receive data from it. Let’s set up a watch window just to test this. We started our remote inputs coming in at X100, and I happen to have two input devices—those two little switches. So, I’ll monitor both of those values.

Then, we have our remote output coming from Y100 and going to our remote IO block. If I start watching… it looks like both of our inputs are False on our remote input device—our little switches over there. I’m going to turn them on. Let’s see what happens.

Okay, I turned the first switch on, and we can see that over here on our watch window, that value did update. Let me do the same thing with the second switch. So, it looks like our remote inputs are working.

The next thing to do is to toggle our output and see if the lights on the remote IO block light up. I’m going to turn on this little light and check it—and I do have the output light indicating that the remote output is active. Turned on. Same for this one.

So, our Modbus TCP communication is successful, and we are successfully reading and writing inputs and outputs remotely using our remote IO block. Thanks for watching!

 

Thank you for watching and please call (855) 737-4716 or fill out our online form if you have any questions.