LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic Timeout Newbie Question

Solved!
Go to solution
Hi, I have written a subVI which sends a command(gpib write) to a physical instrument. Ocassionally it will become stuck at the gpib write VI. I would like to program this subVI such that the failure of this subVI will not result in the failure of the entire program. I have tried different "timeout ms" values, it doesn't seem to help my problem. Is it possible to abort the operation of this VI and return a default value when it becomes stuck like this for X many seconds? Any help would be appreaciated.
0 Kudos
Message 1 of 18
(4,395 Views)
If you get a timeout doesn't that create and error message?  You can wire the error to a case structure or error handler to process it instead of getting the default pop-up.
Message 2 of 18
(4,388 Views)
Thanks for the replym I guess I am using the word "timeout" when I don't know what it means. When I inspect the problem with highlight execution, I notice the program remains stuck at the "gpib write". No errors are generated, no outputs are produced, and I get no error messages. This leads me to believe that the "gpib write" never finishes executing.    I would like my higherlevel program to continue operating instead of staying stuck at this place. 
0 Kudos
Message 3 of 18
(4,370 Views)
aaaaaa.JPG
0 Kudos
Message 4 of 18
(4,359 Views)

here is an example for 10scounter.vi

 

hope it helps

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 5 of 18
(4,331 Views)
Thanks for the reply,In my case, (Labview 8.5) there are occassionally times when the program fails to finish execution of the GPIB write VI. So regardless of how long or short I "wait" the while loop will not proceed. This is why I want to kick myself out of the while loop after 10 seconds. 
Message Edited by DoomPirate on 06-30-2009 12:33 PM
0 Kudos
Message 6 of 18
(4,326 Views)

Sorry I can't be of more help, I have never had a command fail to timeout.  Your example writes the same data 10 times.  The delay you have gives the GPIB only 50ms + 50ms timeout.  It's possible that you are calling the function again before it has reached timeout.  I would increase the time between 'writes'  and see if the performance improves.

Message 7 of 18
(4,319 Views)
Because the program never finishes executing the GPIB read(I just realized I've been having trouble with read not write) command, the while loop never iterates past the first cycle.
0 Kudos
Message 8 of 18
(4,308 Views)
Is the read imediately after the write?  You can try putting a delay between the two.
Message 9 of 18
(4,286 Views)
No :'( In my scenario, I am only reading from the device. Never writing. The first read iteration never completes whenever I have the GPIB cable disconnected from the device. I want to have error handling but the program hangs at this one spot.    I have posted the code here for download zxc.JPG
0 Kudos
Message 10 of 18
(4,279 Views)