Jump to content

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?


  • Upvote 1
Link to post
Share on other sites

Below my dirty work around. The communication is now working for 2 hours.

If the "NumOfClients" is grater than 150 the Modbus Slave address is set to 2 for one PLC cycle. This triggers a reset of the "NumOfClients".


Link to post
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).



Link to post
Share on other sites

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. 


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


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?


Link to post
Share on other sites

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


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-



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 post
Share on other sites

We're having the exact same issue as Daniel_EWW.

1.28 works fine.  Upgrade to 1.29 and the Modbus serial NumOfClients starts to grow, hits 165 and dies.

This is with a single Modbus device as a master and the PLC is the slave.

Link to post
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.

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