LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout Error on VISA Read when full program runs

Solved!
Go to solution

In my application I need to read an instrument via a USB serial COM (an Heidenhain ND 280).

 

When I run a VI alone that just Write and Read the needed data it works fine (see attached). But when the main Vi runs and this runsin a SubVi it always gives a Timeout error on the VISA read after some time.I don't get what causes that. 

 

EDIT : In fact even alone it will give a timeout error after some time. I just let it run for 30 minutes and it gave one. It just seems longer to appen than when the full program runs.

 

Thank you,

0 Kudos
Message 1 of 14
(6,439 Views)

You should use the VISA Resource out of the Configure Serial Port in your loop.  That would also make sure the read and write happen after the serial port is configured.

 

Since you are using a USB-Serial adapter, go check your USB power settings in the Windows Device Manager.  Windows 7 introduced this "feature" where the USB hub will be randomly powered off.  Make sure that is disabled.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 14
(6,423 Views)

I have had many bad experiences with the USB to serial adapters. Especially the ones that use the Prolithic drivers. The drivers randomly lock up. This could also be the case for you. 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 14
(6,410 Views)

I do not have an adapter. My instrument can be pluggued serial or USB with a usb driver :

Capture_usb.PNG

 

Found the driver on the manufacturer website.

 

I wasnt really clear, see as writen is the manual of the device :

'The ND 280 features two serial interfaces : RS_232 and USB (UART, X32)'

 

I did the Windows device manager thing just in case. 

0 Kudos
Message 4 of 14
(6,404 Views)
That sure looks like a usb-serial adapter to me. What is your definition?
0 Kudos
Message 5 of 14
(6,391 Views)

So be it if it is. I'm just telling you what i'm using and that I don't have a physical adapter between my device and my computer. 

0 Kudos
Message 6 of 14
(6,383 Views)

This is best USB to serial adapter I ever worked on.  This error has nothing to do with timeout error. Yes its true it goes to sleep to save power. In control panel uncheck  the sleep option from power management.

 

Main reason you are getting timeout is only have following reason

 

1. Number of bytes not comes within timeout.

2. Implementation of your VI.(The way you write your logic based on your appearing data)

 

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Message 7 of 14
(6,359 Views)

Is there a way to change the timeout time of the VISA read?

Or could it be because I'm trying to read too fast?

 

Thank you,

0 Kudos
Message 8 of 14
(6,307 Views)
Can you attach images of the block diagrams of the main and subVI. I'm posting from my phone.
0 Kudos
Message 9 of 14
(6,303 Views)

I went back to just testing it alone until it works for now :

 

Capture3.PNG

The graph is just for me to know when the error occured. 

0 Kudos
Message 10 of 14
(6,291 Views)