Jump to content

Polling various Modbus slaves and registers


Recommended Posts

Hi there, 

I have to update program on a site where we already have 2x samba 43 in place, 

I will need to poll some modbus values and show them on the displays from 4 RS485 devices, - VSD and soft starters, these will all be on a RS485 to TCP gateway, in my complete program

I have made a separate working example of what i'm trying to do, by using 2 spare sambas i have, as a master & slave combo i just wanted to know if its the best practice way of doing it when polling the 24 to 30 different values needed

I am also curious about the settings to do with SB168 Link lost auto recover, do i then need to set some time values in SI 103-110 to make it work properly?

Any help or advice is always appreciated!

 

network.vlp network slave.vlp

Link to comment
Share on other sites

Here are my suggestions.

This part here:

Capture.PNG.b0d6b689cb8aa07d6f71902900a989f1.PNG

If no connection is established due to some reason, T0 will stay on and PLC will not try to reconnect again. T0 should restart if there is no connection after some time.

Since you do both master and slave pack all registers that you need to read from slave one after another and then read them all at once with one command (Vector length 24 in read command). It's more efficient than reading them one by one.

About SB168 I always Set it at startup as suggested and Set SI103-106 to 200. Don't know how it behaves if values are left blank.

I'm curious does your method of calling Modbus commands works? Have you tested it?

Link to comment
Share on other sites

Thanks for the reply, yes my sample projects attached work great, I have 2x sambas on my desk for testing, i split the registers up like that to simulate reading from multiple slave devices across various registers.

i have done as suggested with SI103 etc that works great, and reconnects after a short period

Link to comment
Share on other sites

3 hours ago, Isakovic said:
On 8/11/2020 at 7:41 AM, Kieran B said:

yes my sample projects attached work great

I like your style.

It's more efficient, I have separate bit for every Modbus command. Will give this method a try.

Kieran

I would like to see  your "style",  I sometimes do MODBUS and I always feel my code is clunky....

But I can't seem to download your sample projects, as though they are now dead links...

Regards,

JohnR

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...