Modbus RTU maximum channel number

Topics about the Software of Revolution Pi
Fabrizio
Posts: 16
Joined: 24 Jan 2024, 09:44

Modbus RTU maximum channel number

Post by Fabrizio »

Hello. I need to configure the RevPI to acquire about 100 channels (more or less) read from 50-60 different sensors. Is it possible using a RevPI compact?
If yes, shall I have any limitation on configured polling time or any other drawback?
At the moment, I'm successfully using RevPI compact to acquire 10 modbus signals, but I saw that I can configure maximum 32 channels.
Thank you in advance
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Modbus RTU maximum channel number

Post by dirk »

Hello my friend, this is certainly difficult to answer without a test setup. I don't think it's possible with the on-board tools we provide. It is a simple Modbus interface. Of course, there are ways around restrictions here and there, these are the following:

1. Use the Modbus RTU Master 150 module in PiCtory - now you have 150 registers
Modbus RTU Master 150 Module
Modbus RTU Master 150 Module
chrome_tTWJralvam.png (14.16 KiB) Viewed 9208 times
2. deactivate the limitations and validity checks - now you are somewhat in off-road mode
Extended Data Disable Limits
Extended Data Disable Limits
Good luck!
Fabrizio
Posts: 16
Joined: 24 Jan 2024, 09:44

Re: Modbus RTU maximum channel number

Post by Fabrizio »

Thank you Dirk.
When I configure for maximum 150 channels, the polling time adopted by RevPi for each channel is computed using the same logic used when I configure the standard master RTU?

Then when you say "I don't think it's possible with the on-board tools we provide", you refer to my question if there can be limitations or any drawback in the managing of an high number of channels as in my use case?

Thank you again.
Fabrizio
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Modbus RTU maximum channel number

Post by dirk »

Hi Fabrizio,
Thank you Dirk.When I configure for maximum 150 channels, the polling time adopted by RevPi for each channel is computed using the same logic used when I configure the standard master RTU?
Well the code is online thus the logic, see here:
https://gitlab.com/revolutionpi/revpi-modbus
Then when you say "I don't think it's possible with the on-board tools we provide", you refer to my question if there can be limitations or any drawback in the managing of an high number of channels as in my use case?
Yes, the easiest but only way to prove is to do the setup. For example, user jejmule mentioned that for example there should be a configurable delay between the requests so that responses can be received properly, etc.
viewtopic.php?p=15737#p15737

Here is another interesting discussion from user Nils on the feasibility of single writes via Modbus and alternatives to the process image.
viewtopic.php?p=11676#p11676

User ostermann has also examined some things here with the help of an oscilloscope and done a good job. However, the discussion was a little longer ago:
viewtopic.php?t=3271

I hope that these explanations will help you to decide how you can implement your application here.
Fabrizio
Posts: 16
Joined: 24 Jan 2024, 09:44

Re: Modbus RTU maximum channel number

Post by Fabrizio »

Thank you very much Dirk, for the useful information.

I can also evaluate the use of another RevPi module, different from the Compact version I already used.
The purpose is to have more than one Modbus RTU Master bus, so I can distribute all the sensors I have to manage on 2 buses.

Could you suggest me the best way to obtain this?
I saw that a way can be the use of a USB-RS485 converter to be attached to RevPI USB, and configure it as a second Modbus channel (in this case, could you suggest me a converter you already used for this?).
Are there any other method? (I didn't find any Modbus RTU expansion modules...)
Or use Modbus TCP Master coupled with a Modbus TCP-RTU converter?


Thank you,
Fabrizio
Fabrizio
Posts: 16
Joined: 24 Jan 2024, 09:44

Re: Modbus RTU maximum channel number

Post by Fabrizio »

Hello Dirk.
I find that the RevPI Flat has 2 different RS485 channels (I didn't found it previously!). So I suppose it can be used to manage my previous request (have 2 Modbus RTU Master channels).
Are they completely independent and configurable with different communication settings?

Thank you.
Fabrizio
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Modbus RTU maximum channel number

Post by dirk »

Hi Fabrizio, yes good point, the RevPi Flat S modules have
  • RS485-1
  • RS485-0
See here:
https://revolutionpi.com/en/tutorials/revpi-flat-s
And here
https://revolutionpi.com/en/tutorials/o ... essen-flat


Good idea.
Attachments
chrome_gCn2Xfl8ZN.png
Fabrizio
Posts: 16
Joined: 24 Jan 2024, 09:44

Re: Modbus RTU maximum channel number

Post by Fabrizio »

Thank you Dirk.
I'll proceed with RevPi Flat.

Regards,
Fabrizio
Fabrizio
Posts: 16
Joined: 24 Jan 2024, 09:44

Re: Modbus RTU maximum channel number

Post by Fabrizio »

Hello Dirk.
I'm trying to communicate with more than 32 slave registers (I configured a Modbus RTU Master 150 to allow this configuration on Pictory), but it seems that no more than 32 actions can be performed by RevPi.

I'll try to better explain my tests.
I configured 48 actions on Pictory to acquire data from 16 sensors (3 different measures for each one).
So I obtains with Pictory the assigning of the variables Input_Word_1, ..., Input_Word_48.

As a test to check the acquisition I use the tool "piTest" and it returns valid values til Input_Word_32.
I verified that this is not a problem of the slaves, because moving on Pictory the configuration of the slaves, exchanging the first 32 actions ones with the others, I'm always able to read the ones associated to the first 32 actions.

This means that RevPi is not able to manage more than 32 actions for every modbus channel?
If this is the case, why I can configure more than 32 actions (using Modbus RTU Master 150)? Is there another manner to interact with the registers exceeding the first 32?

Thank you,
Fabrizio
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Modbus RTU maximum channel number

Post by dirk »

Fabrizio, thank you very much for the error report. As I have already said, you are in "off-road mode".
The Modbus interface that the RevPi offers is simply not designed and tested for such a load.
Have you ever thought about designing your application differently?
For example, it is also possible to use the RS485 interface directly. Why don't you do a test with a Python code example for Modbus RTU. If this works, you can either take advantage of the process image and use a virtual module to store the received values there. This has the advantage that you can access these values atomically. A second process can then read this data from the process image and do something with it.
Post Reply