Hello everyone! I recently bought a Schneider M241 PLC for a new product line we're developing. It's affordable and programmed using CODESYS (also known as Schneider Machine Expert). While waiting for the PLC to arrive, I started working on the program and encountered a significant issue related to reading data from a Modbus TCP slave device. The device uses discrete, holding, and input registers that need to be accessed using Modbus function codes 02, 03, and 04. I followed online guides to set up the Slave device by adding a 'Generic Modbus TCP Slave Device' to the Industrial Ethernet Manager. However, when trying to define the Modbus TCP Channel Configuration, I noticed that I only have options for function codes 03, 04, and 23. I did some research and found that this may be consistent with Schneider's documentation for the M241 Modbus Master Mode. After further investigation, it seems like only function code 03 is supported for scheduled scanning of Modbus TCP slaves. This limitation is surprising, as the M241 is capable of supporting a wider range of function codes when set up as a Modbus TCP Server (Slave). It's puzzling that function codes 2 and 4 are accepted in slave mode but not when operating as a master. I would appreciate any insights or solutions to this issue, as it's a crucial requirement for our system. If we're restricted to only reading holding registers, we may need to consider switching to a different PLC. Thank you.
Don't forget to check out the read_Var and write_var blocks in your configuration. The IOscanner is set up on the hardware, with read_Var and write_var blocks serving as unique PLC code instructions.
I appreciate your assistance. It seems that using READ_VAR allows me to access different types of registers on my M241. I am also interested in configuring my M241 as a Modbus slave but I am unsure of the correct method. According to the M241 programming manual, it suggests that I need a TM4ES4 expansion module for this purpose. However, I am doubtful of this requirement since my base M241 module (TM241CE40R) already has an ethernet port. I have not found any other information in the guide regarding setting up the M241 as a Modbus slave.
Utilize the built-in Ethernet capability for Modbus communication by simply assigning an IP address. All variables listed on the Global Variable List (GVL) require mapping to Modbus addresses. The syntax likely involves declaring "My_symbols_name int at %MWxx" where I/O is automatically mapped to Modbus ranges. Configuring a slave device involves a slightly different approach compared to your current setup, functioning more like remote I/O for other PLCs using Modbus TCP protocol.
I've encountered a similar issue when working with Schneider M241 PLCs. Alas, it seems your research is spot on. The M241, when used as a Modbus Master, primarily supports FC03 for scanning Modbus TCP slaves. It's an apparent limitation of the device's default configuration and something that isn't always abundantly clear in the documentation. You could potentially reconfigure the physical devices to make everything work through FC03, which I understand isn't an ideal solution. On the other hand, a PLC with richer Modbus Master support could prove less frustrating. In such scenarios, I've found Siemens and Allen-Bradley PLCs to offer more flexibility. Good luck!
Hey there! I've worked with the Schneider M241 PLC a lot and ran into similar issues initially. Unfortunately, I have to confirm your findings. While being in Master mode, scheduled scanning is indeed limited to function code 03 as per Schneider's documentation. It's quite the bummer, considering the full capability when in slave mode. But before you decide to switch PLCs, you might explore using the unscheduled READ_VAR function, via which you can access all types of register data. It's not as convenient as the scheduled scan, but you might find it's good enough for your project.
Hi there! I've also worked with Schneider M241 PLC and similar Modbus TCP issues. An unconventional workaround I've tried was to use a bridge PLC that supports all function codes, communicate with your device, and then relay the readings over a different protocol or communicate directly with your M241. Another solution could be considering an external Modbus TCP to Modbus RTU converter as the M241 change the function codes when using Modbus RTU. Sure, these might cost you a bit extra, but it could potentially be a more cost-effective solution than switching to a different PLC entirely, especially if you're already familiar with CODESYS. Hope this helps!
Hi there, your issue indeed sounds like a tricky one. In my experience, different PLCs certainly have different supported function codes for Modbus communication. I understand why you'd be frustrated! The Schneider M241 PLC may limit the function codes in the master mode due to its operational parameters or architectural constraints. However, there may still be a workaround for your problem. You could consider mapping the data from the discrete and input registers to the holding registers in the slave device, if it supports that functionality. That way, you can then read them using function code 03. Alternatively, you could also consider using an intermediary device, like a protocol converter or a data gateway, that could translate the unsupported Modbus function codes. I hope this helps somewhat as you find a solution more tailored to your needs. Good luck with your new product line!
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: The limitation of only having function code 03 available for scheduled scanning of Modbus TCP slaves on the M241 PLC is due to the Modbus Master Mode configuration. This restriction is mentioned in Schneider's documentation for the M241 PLC.
Answer: When operating as a Modbus TCP Server (Slave), the M241 PLC is capable of supporting a wider range of function codes, including 02 and 04. However, in the Master Mode configuration, only function code 03 is supported for scheduled scanning of Modbus TCP slaves.
Answer: If the restriction to only reading holding registers using function code 03 is a critical limitation for your system, you may need to consider switching to a different PLC that offers broader support for Modbus TCP function codes.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.