Ask our Experts
Didn't find what you are looking for? Ask our experts!
A forum for topics related to the scope of Modicon PAC offers and ecosystem along the whole lifecycle: Modicon M580 and 340, EcoStruxure Control Expert, EcoStruxure Process Expert (Unity Pro) and more.
Search in
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-22 11:19 AM . Last Modified: 2025-11-22 05:30 PM
Hi all,
Could someone please help me with the issue below?
I am facing a problem when trying to send a WRITE command from an M340 controller to a Modbus slave device over Modbus RS485 serial communication. I’m able to read all data from the device successfully, but for some reason the write operation is not working. Every time I attempt to write, I receive a “Slave No Response / Timeout” alarm.
Here’s what I have verified so far:
I connected to the slave device using Modbus Poll and was able to write to the same registers without any issues. This confirms that the slave accepts write commands and is functioning correctly.
The RS485 cabling is directly from the M340 serial port to the slave device (no converters or intermediate devices).
Termination resistor is installed on the slave side.
READ_VAR is working perfectly and returns all data from the slave.
I’ve attached the M340 port configuration snapshot, as well as the READ_VAR and WRITE_VAR instruction settings, along with the slave device user manual.
If anyone has suggestions or can spot something I may be missing, I would really appreciate your help.
Thank you!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-25 05:43 PM
The issue was resolved by using the Data_exch block instead of Write_var to send the command to the slave.
Attached is a DFB that can be used to write a single register to a Modbus slave device. A sample configuration is included for reference, and the parameters should be adjusted to meet the specific requirements of the slave device.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-23 12:16 PM . Last Modified: 2025-11-23 12:17 PM
Please use a different address for writing the variable.
Example:
READ_Var: 0 to 120
WRITE_Var: 12 (Instead of 12, use 201
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-23 04:19 PM
Hi KLSM, Thanks for your reply. I have tried with 201 but no change. I checked using modscan and the slave unit starts when I write 1 to register 12.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-23 05:25 PM . Last Modified: 2025-11-23 05:29 PM
You do not seem to be using the activity bit of the communication management block to confirm completion of the previous communication before starting the next request. Using a timer by itself is not a guarantee that the previous communication has completed.
In your communication management parameters, the first bit of the first word is used to indicate the communications is active. Only start the next communication when timer has completed and the bit is off.
Make sure you are using unique addresses for each of the communication management blocks so that each request has its own block.
reference https://www.se.com/au/en/download/document/33002527K01000
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-23 08:18 PM
Can you confirm which modbus function was used on modpoll to write to the registers? Some devices does only allow function 16 (multi-register write) and not function 6 (single write). If possible you can try writing 2 registers from the WRITE_VAR to force function 16.
As Trinxs also mentioned best is to wait for activity to finish example
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-23 08:42 PM
Hi Hennie, I tested Function 6 using Modbus Poll. I connected the Modbus cable to my laptop through a converter, and the Modbus Slave application is receiving the correct data from the PLC. But for some reason slave device is not receiving data from plc
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-23 09:57 PM
Hi, can you try connect the converter to monitor the traffic between the PLC and the slave and we can check what the response code from the slave is? Most Modbus poll software has a mode for monitoring.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-11-25 05:43 PM
The issue was resolved by using the Data_exch block instead of Write_var to send the command to the slave.
Attached is a DFB that can be used to write a single register to a Modbus slave device. A sample configuration is included for reference, and the parameters should be adjusted to meet the specific requirements of the slave device.
Link copied. Please paste this link to share this article on your social media post.
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.