Jump to content

Modbus RTU problems with 1.29


Daniel_EWW

Recommended Posts

For the communication with Siemens PLC’s we use an Anybus device. In the version 1.26 everything works fine. With the 1.29 version, the NumOfClients is increasing to 165 and after approx. half an hour no more data is exchanged with the Anybus device.
 

Any ideas for a work around? Is this a Modbus bug in the 1.29 version?

2020_07_16_08_14_33_Neue_MGT_2020_04_27_V130_SDA_UniLogic.png

  • Upvote 1
Link to comment
Share on other sites

Joe, thanks for your answer.


I want to replace the modbus slave configuration with a ladder logic listening on the RS485 CPU interface.
Enclosed the picture with slave configuration and a beginning of ladder logic (cannot work this way but hopefully points out what to do).

Joe, just out of curiosity. Are you a Unitronics employee?

I’m not happy with the 1.29.111 version. Often get the “HMI overload message”. Sometimes after a download, the screen stays black (only power up can resolve it).

 

Modbus_Slave.png

Link to comment
Share on other sites

  • MVP 2023

So is the Master going to send a straight ASCII string, like  "11,03,6B" or will it be "1103006B"?  What about the number of operands requested?  I think you need to add that unless it's always 1. 

Understand the the UniStream is the Master on the RS485 port for these blocks.  If you're trying to change the personality of the UniStream as a Modbus Slave device, it can not be done.  The Slave ID of the UniStream is fixed in the project.

If you want to have the UniStream act as a "Multi-Slave", you will have to continue along the path you show above and roll your own Modbus Decoder / Responder.

 

So this may not be what you're asking about, but I looked  into it anyway as I wasn't familiar with these blocks and I'm sure others on the forum will want to know about them.  These are dynamically allocated Modbus configurators and will allow Modbus reads and writes to be determined by tag values.  The Modbus tables are easy to use, but sometimes you need more power.  

I dug into the Modbus Advanced blocks to figure out how to use the Read Parser and the Read Builder - these are pretty new features which is why they're not in the examples.  They look fairly straightforward - I'll build a project to test them.

An initial observation - the Modbus Request Struct for the Builder block is all in decimal. 

image.png.cd20380b48247ea5720cfec90997355e.png

Although I'm not seeing where the IP address is if TCP is specified.  I'll have to ask about that. 

I'm still running UniLogic 1.28.34.

I'm not a Unitronics employee, but I've been a distributor in the US since 2000 and also do system integration.  In my past life I was an engineer doing PLC programming for the Modicon distributor, so between that and Unitronics I know a bit about how Modbus works.  We did Allen Bradley as well, and I still do AB projects if the user wants to pony up the $$.

 

Joe T.  

Link to comment
Share on other sites

Joe, thanks for your time to give a comment to my problems. Enclosed is a pdf with my experimental Modbus slave solution for our job. Took me several hours playing around. The following page http://www.simplymodbus.ca and the program qModMaster helped me to do this.

Why do we need this:
In my second post of this thread, I changed the Modbus Slave Address to reset the “NumOfClients”. This works for about 6 – 10 hours. Then suddenly the Status of the Modbus Set Functions changes to -1 and the communication is dead again.

I hope that the new solution works… I will post an update in a few days.

Quote

Understand the the UniStream is the Master on the RS485 port for these blocks.  If you're trying to change the personality of the UniStream as a Modbus Slave device, it can not be done.  The Slave ID of the UniStream is fixed in the project.

I'm not sure if I understand your limitation correctly. I understand that in Modbus RTU only one master is allowed due to the hardware pegel of the signals. But does it matter if I use the RS485 CPU COM Port or the UAC-02RSC_0 RS485 port?

Modbus_Slave.pdf

Link to comment
Share on other sites

  • MVP 2023

I've played with the Simply Modbus programs.  They are very handy indeed.

My personal Modbus tool is from these guys - https://www.calta.com/mdbus.htm.  It does everything in one package.  It is not free but it's not super-expensive.

While you're learning about how Modbus works be sure to check out the original Modicon specification: https://modbus.org/docs/PI_MBUS_300.pdf .  It's a bit dry but it's an excellent reference on how the Modbus frames are structured. 

No, it doesn't matter which RS485 port you use for what you're doing, but if you're using the CPU port for your manual decoder set the config for Tx/Rx so you can access it as COM struct "RS485 CPU COM Port".

image.png.848bf0324af0d4558110fc548d4fa2ba.png

I was referring to the UniStream being the Master or Slave on the CPU RS485 port only if you are utilizing the built-in Modbus protocol tables-

image.png.425146f0ffd34f75b929c828b6ec677f.png

 

I am curious why it works for a few hours and then locks up.  It may help if you clear your buffers out after you use them.  Buffer tags are kind of the Wild West of UniStream memory - it's raw data and you can do whatever you want with it.  I don't know how old you are, but back in the day Windows NT 3.51 was famous for "memory leaking" and grinding to a crawl.  There were little utilities you could get that would periodically purge the RAM.

Joe T.

 

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