LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus timeouts

Highlighted

Hi All,

   I'm having some regular, but intermittent, timeout errors (error 6101) from the MB Serial Receive.vi during its "Read the slave address of the query to make sure it's for this slave" frame. I'm using a EasySync USB serial adapter, set up as RS485.

 

Thanks!

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 1 of 11
(3,380 Views)
Highlighted
0 Kudos
Message 2 of 11
(3,372 Views)
Highlighted
0 Kudos
Message 3 of 11
(3,371 Views)
Highlighted

Thanks Muks,

   Did a search on Modbus last night before posting, didn't think to do a search on the actual error. My problem is that the error happens after a random period of time on a very simple transaction, where I'm just sending a message to check the status of my instrument (Lighthouse Mini-Manifold, a port switch for a particle counter), which returns a signal value, which I parse into individual bits. I do this about every 200 mS, Have the timeout set to 3 seconds. When it fails it will get to the query, hang for the 3 seconds and the returns the error. I'm thinking of adding a filter for the error and do a retry when I get back to the site (2 hours away), I'm sitting in a car repair shop's waiting room now. I'm concerned that the problem is another symptom of the intermittent problems I've seen with the USB based stuff. I've also had problems with the USB6221 I'm using with the tester, but in this instance it wasn't being used, although it was connected.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 11
(3,358 Views)
Highlighted

Well, I've added code to my Modbus calls to filter the 6101 errors, and retry a few times before giving up. It was running ok for an extended time yesterday when I left my customer's site. Not sure where the timeout errors are originating, my end, serial interface (USB to RS485 adapter) or at the instrument end. No real history with this instrument.

 

Anyone know what the difference is between the Modbus library I down loaded a few months ago from NI  (ni_modbus_1_2.zip) and theone currently showing up (nimodbus121.zip)?

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 11
(3,332 Views)
Highlighted
Continuation to this thread over here: http://forums.ni.com/ni/board/message?board.id=170&message.id=457685&requireLogin=False .
Vivek Nath
National Instruments
Applications Engineer

Machine Vision
0 Kudos
Message 6 of 11
(3,289 Views)
Highlighted

Hi All

I have the same problem like Putnam.

I get the timeout error after 2-10 hours runningtime.

 

We use three Eurotherm 2704 temperature controller. The temperature of all loops should be read and written (all in all 9 values to read and 9 values to write).

The controllers are connected via KD485.

I use the ModBus protocol.

 

I work on this problem for ca. two weeks and can not find the solution (the problem is, after I changed something, I have to wait many hours to know if it works or not (It does not work 😞 ))

 

The first  assumption was the (to short) dalaytime between the requests. I try out all possible values for it (from 20 to 600 ms), but it does not help

(I changed the sequence of requests so, that I read/write the data from

 

device1 loop1 -> device2 loop1 -> ...-> device2 loop3 -> device3 loop3

 

to increase the time between the requests (so I have 3*dalaytime between the requests to one device)), no change.

 

In the meantime I am sure, that the delaytime is not the reason of the timeout error. I attached a "simplified" part of the program, where I read/write the temperature, but I think, the program is ok (If not, please tell me).

 

I tried to change the serialport properties without  success as well (the properties you can see in an other attached file).

 

In the temperature controller I  switch on the dalaytime (10 ms)

 citation: "This introduces a short delay between messages to allow some ‘intelligent’ RS485 converters to switch between Rx and Tx modes."

 

I have no idea more, what I can do.

 

Can you help me to find / solve the problem please. It is my master-work and I have the deadline on 19-th febraury (((((

Do you have any idea, how can I localize the problem ?!!!

 

Please belive me, I read ALL of threads here (with tags "Modbus, 6101, timeout") and some other sites as well.

The problem is known, but not the solution of it (I tried many of recommendation out).

 

I suppose, that the problem could be in the KD 485 or the connection (cable or whatever) but I am not familar with hardware.

 

I hope you have some good tipps for me.

 

Thank you.

 

Kind Regards: Alexander Mueller

Message Edited by alexphysiker on 02-10-2010 09:47 AM
Download All
0 Kudos
Message 7 of 11
(3,125 Views)
Highlighted

soory, I forgot to save the file befor I upload.

I will upload the new file in couple of minutes.

 

Alex

 

here is the vi

Message Edited by alexphysiker on 02-10-2010 09:55 AM
0 Kudos
Message 8 of 11
(3,118 Views)
Highlighted

What I did was to check right after the "query" for the 6101 error, and if I got it retry. I set it up to retry a preset number of times before giving up and it seems to have helped, except when, as described in a very long thread of mine, the system has glitched and I no longer have the same ports in MAX. I think that probably isn't your problem, but as Ben mentions (the link a few entries earlier in this thread) there may be some timing issues where there were no time delays in loops in some of the ModBus vi's.

 

Good Luck, these things make us programmers age rapidly.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 9 of 11
(3,102 Views)
Highlighted

Hiya

I got it ))

It is not the "real" solution, but the program running now as long as necessary.

After the reading/writing of temperature I catch the error (in my case it is the temperature 0 for example, you can try to catch the "6101 Error", I tried it, but it doesn't work in my case), 

if I got the error I close the VISA and after short break (500ms) open it and read/write temperature again (I have a loop to do it three times, after that it breaks, but it works allways after the first closing/opening).

I get the error but the program runs continuing. 

 

So, finally after 6 months developing time it "works" ))), one week befor deadline 🙂

 

I wanted to say THX all guys, who helped me by developing of my project.

 

First of all: 

 

Putnam Monroe (LV_Pro)

smercurio_fc

Owen.S

 

whitout your help it would be more difficult to do it.

 

May be we "meet" us here again, if I work as a LabView Developer 😉

 

Thank you

Danke 

Спасибо

 

Alexander Müller!!

0 Kudos
Message 10 of 11
(3,043 Views)