LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get timeout to work as expected for USB VISA

Hi,

 

I'm using VISA in LabVIEW (7.1) to talk to a custom USB device. My program transmits a request and waits for the response (See attached block diagram). The response may take a long time and my program then sits in the Read vi and becomes unresponsive, which is not ideal. I would prefer to set a short timeout and call the Read vi repeatedly, but   my problem is that whatever I set the timeout to,eg, 500ms the VISA read vi waits for about 10 seconds if no response is received. 

 

Where am I going wrong?

 

Thanks,

Mike 

0 Kudos
Message 1 of 3
(2,971 Views)

MW,

I think yo'll have to attach the code for us to look at.  The first thing I would do is look through the sub-vis and other sequence panels to find out where the TMO value is being reset.  the VISA read will only wait for TMO.value milliseconds.

 

Is the read returning a timeout error?  or is something else going on?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 3
(2,955 Views)

Is there a particular reason you don't want to wait for a response?  I'm looking at the picture and it would seem that waiting for a flash write to complete would be extremely important before doing anything else.  (Like stopping the VI for instance).  I'd make a VI with a front panel that says "WAITING...", call it right after the command to flash as a dialog, make the cursor busy, then close the VI nd "un-busy" the cursor when VISA returns a response (with appropriate error handling on timeout, of course).

 

Bill

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 3
(2,936 Views)