Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Categories
  • Forums
  • Knowledge Center
  • Blogs
  • Ideas
  • Events & Webinars
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

M340 Modbus RS485 – READ_VAR Works but WRITE_VAR Fails (Slave Timeout)

Modicon PAC Forum

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

Improve your search experience:

  • Exact phrase → Use quotes " " (e.g., "error 404")
  • Wildcard → Use * for partial words (e.g., build*, *tion)
  • AND / OR → Combine keywords (e.g., login AND error, login OR sign‑in)
  • Keep it short → Use 2–3 relevant words , not full sentences
  • Filters → Narrow results by section (Knowledge Base, Users, Products)
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Industrial Automation
  • Modicon PAC Forum
  • M340 Modbus RS485 – READ_VAR Works but WRITE_VAR Fails (Slave Timeout)
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
Trinxs1
Lt. Commander Trinxs1 Lt. Commander
11
YONGHO-KIM
Lieutenant YONGHO-KIM Lieutenant
9
ciupol
Lt. Commander ciupol
9
View All

Recommended Forums

  • Industry Automation and Control Forum

  • Machine and Motion Control Forum

  • Alliance Partner Program System Integrator

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to Modicon PAC Forum
Start a Topic
Solved
BennyJoseph
Crewman BennyJoseph
Crewman

Posted: ‎2025-11-22 11:19 AM . Last Modified: ‎2025-11-22 05:30 PM

0 Likes
7
325
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

M340 Modbus RS485 – READ_VAR Works but WRITE_VAR Fails (Slave Timeout)

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 have set the GEST parameter’s 3rd array element(Timeout) to 20 for both READ_VAR and WRITE_VAR.

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!

Attachments
Labels
  • Labels:
  • 06. EcoStruxure Control Expert
  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Next Topic

Accepted Solutions
BennyJoseph
Crewman BennyJoseph
Crewman

Posted: ‎2025-11-25 05:43 PM

0 Likes
0
57
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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.

See Answer In Context

Attachments
FC6.zip
Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 7
KLSM
KLSM Cadet
Cadet

Posted: ‎2025-11-23 12:16 PM . Last Modified: ‎2025-11-23 12:17 PM

0 Likes
1
288
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

 

ControlExpert_Write_VAR.png

 

Please use a different address for writing the variable.
Example:

READ_Var: 0 to 120
WRITE_Var: 12 (Instead of 12, use 201




Reply

Link copied. Please paste this link to share this article on your social media post.

BennyJoseph
Crewman BennyJoseph
Crewman

Posted: ‎2025-11-23 04:19 PM

In response to KLSM
0 Likes
0
278
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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. 

Reply

Link copied. Please paste this link to share this article on your social media post.

Trinxs1
Lt. Commander Trinxs1 Lt. Commander
Lt. Commander

Posted: ‎2025-11-23 05:25 PM . Last Modified: ‎2025-11-23 05:29 PM

0 Likes
0
272
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

 

Trinxs
Senior Technical Sales Consultant - PAC
Reply

Link copied. Please paste this link to share this article on your social media post.

Hennie_Smith
Lieutenant Hennie_Smith Lieutenant
Lieutenant

Posted: ‎2025-11-23 08:18 PM

0 Likes
2
228
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

Hennie_Smith_0-1763957809075.png

 

Reply

Link copied. Please paste this link to share this article on your social media post.

BennyJoseph
Crewman BennyJoseph
Crewman

Posted: ‎2025-11-23 08:42 PM

In response to Hennie_Smith
0 Likes
1
223
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

Reply

Link copied. Please paste this link to share this article on your social media post.

Hennie_Smith
Lieutenant Hennie_Smith Lieutenant
Lieutenant

Posted: ‎2025-11-23 09:57 PM

In response to BennyJoseph
0 Likes
0
213
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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.

Hennie_Smith_1-1763963791793.png

 

 

 

Reply

Link copied. Please paste this link to share this article on your social media post.

BennyJoseph
Crewman BennyJoseph
Crewman

Posted: ‎2025-11-25 05:43 PM

0 Likes
0
58
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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.

Attachments
FC6.zip
Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 

You’ve reached the end of your document

WHAT’S NEXT?

Ask our Experts

Didn't find what you are looking for? Ask our experts!

My Dashboard

Check out the new Feeds and activities that are relevant to you.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support

    Ask our Experts

    Have a question related to our products, solutions or services? Get quick support on community Forums

    Email Us

    For Community platform-related support, please email us

Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

Welcome!

Welcome to your new personalized space.

of

Explore