LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout errors with Modbus serial master query.

I am running Labview 7.1 on Windows platform.  I have a VI that utilizes the modbus serial master query to receive data from a Diret Locic 205 PLC, then parse it out into global variables. The VI runs okay for a while but will eventually generate a timeout error "6101".  After this error occurs, the VI continues to run but no longer pulls in data from the PLC. 
 
Please forgive the ugliness of the VI...I'm struggling through this project as a newbie.
 
Any help would be much appreciated.
Thanks,
Jim
 
Message 1 of 25
(7,717 Views)

Here's an exampe of a VI calling on the globals created in the master VI...in case it matters.

THanks,

Jim

 

Message 2 of 25
(7,711 Views)
Hi Jim,

Is it possible for you to break down this code to a small piece that still produces this problem?  That will make it easier to troubleshoot.  Does this happen on every computer that you run this code on?  You can also use NI-Spy to capture your calls and errors.  Performing a Good NI-Spy Capture for Debugging/Troubleshooting

Thanks!

Meghan
Applications Engineer
Message 3 of 25
(7,686 Views)

Meghan,

Thanks for taking a look at this!  I will work on breaking down the code to a simpler form and try to clean it up a bit.  I'll resubmit when that's done.  In the meantime, I'm running NI-SPY and the VI to try and catch the error again but so far it has not occurred.  Usually it happens within the first 30-45 minutes of run time.  It's been running for over an hour now without problems, which is odd...first time that's happened.  I was having a lot of trouble yesterday so I'm not sure what the deal is.

So far, I've only been running it on one computer while I'm developing it for the application.

Thanks,
Jim

 

Message 4 of 25
(7,672 Views)
Hi Jim,

Take a look at this knowledgebase - Why Does My Application Only Work While NI-Spy is Running?  You may need some timing delays in your application.

Have a great day,

Meghan
Applications Engineer

Message 5 of 25
(7,661 Views)

Meghan,

I have looked at the knowledge base, rewritten the code to include some delays but I'm still getting the error.  I've also included an additional sequence to break the data transfer into 2 reads in case the modbus drivers were not taking care of the transfer.  I know that the 6101 time out error is being generated in the modbus serial recieve subvi that reads the data from the PLC, I just don't know why I'm getting the error.  I suspected that the delay issues would be causing the problems but increasing the delays hasn't helped either.

I've attached the vi as it now stands.  It is functional but hangs periodically.  Any ideas?

 

Thanks for your help,

Jim

 

0 Kudos
Message 6 of 25
(7,624 Views)
Hi Jim,

Thanks for reworking the code, but we're definitely at the start of the troubleshooting process.  The first thing I'm seeing in this code is the potential for a lot of race conditions.  Also, this code is still way to big to troubleshoot effectively.  Rather than have large numbers of registers that you're performing the same/simliar actions on, you need to narrow it down to the smallest code that still produces the error.  I also see where you've added the delays, but  another good place would be in the while loop itself.  Without timing, the loop executes as many times as it possible can, and will tie up CPU, but with timing, you allow the computer time to execute other actions (including things like the mouse moving).

Let me know how it goes!

Meghan
Message 7 of 25
(7,614 Views)
I have the same problem. I am running the Labview 7.1 on windows XP. I am trying to comunicate, via modbus RTU protocol, to receive data from the Andress + Hauser Promass 83 coriolis flowmeter. I tried to use the NI-modbus (MB serial master query.vi) code but doesn't worked. I read a similar situation in http://forums.ni.com/ni/board/message?board.id=170&thread.id=296660&view=by_date_ascending&page=1, but it is for labview 8 or later. There are, in this flowmeter, some diferents parameters like byte order. I achieved to make "a ping" in this flowmeter with other program (digiconfig - http://www.novus.com.br/site/default.asp?Template=../downloads/layout_download.asp&FiltroCategoria=P...). I achieve to see the instrument but a don't to receive any data. Could somebody help me?
David Fiorillo
0 Kudos
Message 8 of 25
(7,182 Views)

Every time which I try to make the communication I obtain the modbus error 6101.

David Fiorillo
0 Kudos
Message 9 of 25
(7,178 Views)
Do they provide any software for communication with their device?  Does that work?  Have you  verified baud, parity, and stop bit settings?  Have you checked that you are writing to the correct Modbus slave address number?  Is it RS-232 or RS-485?  If RS-485, is it 2 wire or 4 wire?  Are you using any isolators, 2 to 4 wire convertors, or RS-232 to 485 converters?
Message 10 of 25
(7,150 Views)