09-10-2009 07:18 AM
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
09-10-2009 09:15 AM
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?
09-10-2009 12:08 PM
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