Use Flexy To Read Tag Values From Schneider M241 PLC

I am attempting to read a couple of values out of a Schneider M241 PLC and am running into issues.

I have my Modbus IO server set up as follows

Modbus TCP Server, Ewon Server = Enabled, Modbus TCP Unit Address = 100
Topic A, Enabled, Slave Address = 1, IP Address = 10.0.0.1)

I am attempting to read data out of a couple of places in the M241 PLC.
%MD0
%MD1
%MD2
%MD3
%MD4

I have set them up the following way in the ewon values page.
Modbus, Topic A, Address = 40001D, Data Type DINT
Modbus, Topic A, Address = 40003D, Data Type DINT
Modbus, Topic A, Address = 40005D, Data Type DINT
Modbus, Topic A, Address = 40007D, Data Type DINT
Modbus, Topic A, Address = 40009D, Data Type DINT

I am getting a “No Communication” error for all tags.

This is my first time setting up tags in an ewon using a Schneider PLC so I am unfamiliar with what I am missing for the set up. Please help.

First you need to find out if the Schneider PLC is acting as a Modbus TCP Client (master) or Server (slave).

In this video from Schneider, it looks like they are setting it up as the Client:

So, if the Schneider is going to be the Client, then you have to set up the Flexy as the Server.

See: KB-0184-00 - Publish tags in Modbus TCP

After you set up the tags in the Flexy, you will be able to write to them from the Schneider.

If you are setting up the Schneider PLC as the Modbus TCP Server, you will follow this document:

AUG-0059-00 - Polling data from MODBUS TCP

I will be able to try some of this tomorrow and will update this ticket with the results.

Thanks for your help so far!

You’re welcome! The most important thing is determining which device is going to be the Client and which is going to be the Server.

I have gotten a chance to dive back into this. I followed the video that you sent and added a Generic_Modbus_TCP_Slave to my PLC project. I gave it the address of the ewon (10.0.0.53). I then created a channel (channel 0). See below…

image

I then entered the following modbus settings on the ewon… (10.0.0.101 is the PLC IP address)

I set up a tag and am no longer getting a status warning/error but the tag is reading as 0. I am not sure what address to put in the ewon to read the tag values. Currently my output tags in the PLC are %QW2-%QW6. How do I translate these values into what the ewon wants to see?

Small update. I deleted the “Generic_Modbus_TCP_Slave” from my PLC project and instead added a “ModbusTCP_Slave_Device”. This allowed me to input an “IP Master address” This also shows holding registers and input registers.

I update the ewon modbus settings as follows.

I set a tag address to 40003 (holding register) with the intention of reading on of the values between %QW2-QW6. Still not getting anything in the value though. I found the following information regarding the M241. To me it looks like I want to be looking at the input register not the holding register. However, anytime I put in a input register for the tag address (3000#) but anytime I do the status of my tag goes into warning/error.

Another quick update…

I am now able to write to the PLC from the ewon but I am unable to read from the PLC. For me reading from the PLC is the more important part to get working.

I am stuck at where I left off on my previous post. Is there any thing that I could try/change in order to read the input registers in the PLC?

Are you sure these are the correct registers to read? Maybe a different function code is required to read these registers? This information should be in the PLC documentation.

I can check if there is someone here that’s familiar with this PLC.

Have you tried just a read function code 4 instead of 23?

image

I believe that the image that you sent was from the “Generic_Modbus_TCP_Slave”. I was unable to read or write when I was using this.

I swapped it for a “ModbusTCP_Slave_Device”. This is the way that I have been able to get the comms half working. I have the following settings.

I then have the following settings in the flexy.

Can you try changing the Unit ID to 1 in all instances, for both devices?

It looks as though that seems to have cause the comms to stop working at all. I can no longer read the holding register values from the ewon with the PLC, nor can I read the input register values from the PLC with the ewon.

I apologize, I was mistaken in my last post. It looks as though the modbus io server did not update when I entered the changes. It looks like now it is acting like it was before. I am able to write to the holding registers but cannot read the input registers.

Are you able to read from the PLC using a Modbus Simulator like Modscan or CAS Modbus Scanner?