Modbus RTU multiple read
-
I'm trying to read data from a device and to make things more efficient I wanted to use the INHEXD function blocks. But regardless of what I do, every two consecutive blocks are always showing the same values.
Am I doing something wrong here...?
If I remove (see below screenshots) the first line which starts at address 10 (holding registers) then the data for the block (which starts at address 26) is shown correctly. Shifting places in the table also doesn't change this behavior.
If I limit the first block to 15 readings then it is working but then I'm missing off course the last reading.Is there a better way to read larger blocks (+16 readings)?
-
Hi Kris,
thanks for your question on Modbus RTU. The behaviour you are observing is strange if the two screenshots belong together. I was trying to replicate the issue on my test bench but without any success so far.
I suggest to use passive option (for doc see: https://www.rexygen.com/doc/ENGLISH/MANUALS/MbDrv/MbDrv_ENG.html#x1-190003.3). It means that you can read large group of registers (up to 125) at one time and divide it to several meaningful parts which are tagged as Passive. See following screenshot:
This means that Modbus provides 24 registers at one time and these are divided internally into smaller groups or individual registers.
Can you try it out, please?
Cheers,
Tomas -
I got this error message... Am I missing something?
-
@apollo Hi Kris, the issue is Item Address in 1st row - why is it 5754? It should be probably 1 according to the passive items.
Cheers,
Tomas -
Because the chunk of data I want to read is located at register 405755, thus address 5754 for the holding registers.
I was thinking that the addresses in the passive ones are relative to the big block of registers from the first line. If I start the first passive one with 5754 and start counting from that point it is accepted and no more fault message.
But I still need to test it in reality.....
-
@apollo I see. I was not really clear. Item Addresses are all absolute - passive or active. Therefore you can have more passive items (e.g. same slave - different register range or another slave).
Please, let me know if it works for your setup which was not earlier.
One more question - what is your Modbus Slave device?
Kind Regards,
Tomas -
@cechurat A InteliDrive DCU Marine from Comap. For testing purpose, we used the normally already occupied serial port (RS232) together with a NPort MOXA 5150A. On the REXcontrol PC we installed the RealCom driver to map the tty port.
But after some testing I am suddenly not able to communicate with the device anymore. Don't know why...but I guess that it has something to do with the RealCom tty port...
I am still waiting for an additional communication card so I can use Modbus TCP directly...... I don't want to spend too much time on setting this Modbus RTU communication up as it will not be what we will be using in the future.....
-
@apollo I understand. Just keep in mind that the Passive feature is available both at Modbus RTU and Modbus TCP.
Kind Regards,
Tomas