LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus error 6101

Hi everyone,
 
In order to get the data from a Modbus device from its 768 to 2314 address, I use the MB Serial Master Query.vi twice because I can not get all the data in one go. Although I 've gotten all data with this way, many 6101 errors appears. For instance, if I request ten times the data from the Modbus device, 6 times the 6101 error appears. I've changed the timeouts but it hasn't worked. 
 
I would like to know how I could get all data in one request, is it possible? I attach the VI that I am using.
 
I'd really appreciate any help.
 
Thanks,
 
Juan Carlos
0 Kudos
Message 1 of 9
(7,307 Views)

I can't look at your VI, but Modbus has some limit which I can't remember at the moment which means you can't read a large number of registers using a single read.

The timeout settings should help, but if I remember correctly, the NI read VI has a loop which reads a single byte at a time and includes a 10 ms wait, which might make your comm take too long if you have a large packet. You should look inside the VIs to see how they implement the communication and change it or use other Modbus VIs, which can also be found on the web.


___________________
Try to take over the world!
0 Kudos
Message 2 of 9
(7,299 Views)
Modbus can only read 100 registers with a single command.
0 Kudos
Message 3 of 9
(7,296 Views)
Are you sure it isn't 128? I seem to remember one of those numbers.

___________________
Try to take over the world!
0 Kudos
Message 4 of 9
(7,294 Views)
Most of the books mention 125 max, but it is only 100 when you access modbus from inside the plc.
0 Kudos
Message 5 of 9
(7,287 Views)

Thank you very much tst and uncle bump for your help.

Now I know why I could just get 110 Modbus registers in one read. Also I made some tests and I've realize that if the number of modbus registers to be read, increases, I have to increase the timeout in the MB Serial Master Query.vi (approximatedly 2 sec with 110 registers to read if I don't want to get the 6101 error).

However, in according with your comments I think it depends on the Modbus device, because I also got data from another Modbus device, but  I could just read 40 modbus registers in one read.

A last question is if timeout errors (such as 6101 error) depend on the speed and  security of a network (WAN) if I am using virtual ports? The problem that I have is the Modbus program works in some networks but in other ones there are a lot of 6101 errors and the data aren't right in most of the reads.

By the way, the program is in LabVIEW 8.2 and I can't change the version.

Thanks again, and I hope you can help me.

Juan Carlos.

 

 

0 Kudos
Message 6 of 9
(7,271 Views)
You should be able to calculate the amount of bytes that you expect to receive. Then use the BytesatPort property node to tell when to read the buffer. Then you can set the timeout to a larger value like maybe 5 minutes.
0 Kudos
Message 7 of 9
(7,264 Views)
Dear Unclebump,
 
The bytes at port property is used in the Modbus VIs (I attached a picture where the VI uses it). Do you mean that sometimes I can get all the data and other times not because of the timeout?I have used 20 seconds in the timeout so far, but I'll use 5 minutes and see what happend.
 
Thank you
0 Kudos
Message 8 of 9
(7,256 Views)

Hi everyone,

I solved my problem requesting three times the data to my Modbus equipment. Before I requested 110 data at the first time and 20 in the second. Now I request 48 at the first time, 64 at the second time and 10 at the third time and the program almost doesn't have 6101 timeout errors. I attached a picture of this.

Thanks everyone for your help.

Juan Carlos

0 Kudos
Message 9 of 9
(7,235 Views)