Jump to content

Samba - Modbus RTU connection to many slaves


Recommended Posts

Dear all, 

I'm programming an application on a  SM43-J-R20 PLC+HMI. I've added a  V100-17-RS4X card, in order to use RS485.

I've succesfully implemented Modbus RTU communication with a Frequency Drive. The thing is, I need to communicate with 11 of them.

The ladder logic so far uses the Modbus function blocks, as can be seen on the Modbus webinars on Unitronics page.

That is, I SET a variable (ex:MB0) , which is used for enabling the "function 06 Modbus"  block (preset holding register).  At the output of the block, I RESET that same variable, ensuring the block gets executed.  At the same time I reset MB0, I SET a new variable (MB1), which in turn is used for enabling the second Modbus block. This creates a sort of "continuous broadcast" to the drivers (which, If they don't receive a command in a certain time, trigger a failure). When the last block gets executed, the sequence restarts,

The question is, when I try to send a Stop command to one driver (for example), it takes an awful amount of time to execute the order (30 seconds or so).

I believe I may have a conflict between some of this blocks being executed at the same time. Is there a tutorial or an example where I can see how to succesfully implement Modbus communication with several slaves at the same time?

Thanks for the support.

Kind regards, 

Martin

Link to comment
Share on other sites

Several slaves at the same time is not posible using Modbus RTU using RS485 network.  You must add a short time between Modbus read/write blocks in order to allow each slave to process and respond back and also to allow PLC to process its buffer.

I´ve used delay timer as short as 50 ms

Keep in mind that, if any slave does not respond immediatly, PLC will wait as much time as you set time-out before polling the next slave. This can be add more time than you expect between whole cycle.

My suggestion: if you really need stop a device quicker, use digital outputs instead of Modbus commands.

 

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...