bbean Posted November 16, 2006 Report Share Posted November 16, 2006 LabVIEW 7.1 I have a VISA read operation that requires a long timeout (5000ms). When the user wants to exit the application I want to abort the VISA read immediately. I have tried Closing the VISA session in a parallel loop. I have tried setting the timeout property to 0 in a parallel loop. Neither of these worked. :headbang: I looked through the NI VISA programming reference manual and notice a command called viTerminate. snip: "Requests a VISA session to terminate normal execution of an asynchronous operation.". Is this what I need to execute and if so where is it on the LabVIEW pallete? Or is there a simple way I am missing? Thanks in advance Quote Link to comment
Rolf Kalbermatter Posted November 16, 2006 Report Share Posted November 16, 2006 LabVIEW 7.1I have a VISA read operation that requires a long timeout (5000ms). When the user wants to exit the application I want to abort the VISA read immediately. I have tried Closing the VISA session in a parallel loop. I have tried setting the timeout property to 0 in a parallel loop. Neither of these worked. :headbang: I looked through the NI VISA programming reference manual and notice a command called viTerminate. snip: "Requests a VISA session to terminate normal execution of an asynchronous operation.". Is this what I need to execute and if so where is it on the LabVIEW pallete? Or is there a simple way I am missing? Thanks in advance I'm afraid this won't work. Since the operation you try to abort is most probably not asynchronous but just waits in the VISA driver itself for the complete or timeout event and is therefore synchronous in nature. Your best bet is to write a VI that does a VISA read in a loop with short timeout instead until data has been returned OR another error than timeout is returned OR your long timeout has elapsed and abort that loop through a global when you need to do so. A tiny bit of programming and thinking but an absolutely fail safe solution that depends nor on external code, nor on specific LabVIEW hidden or version dependant features. Rolf Kalbermatter Quote Link to comment
bbean Posted November 16, 2006 Author Report Share Posted November 16, 2006 Your best bet is to write a VI that does a VISA read in a loop with short timeout instead until data has been returned OR another error than timeout is returned OR your long timeout has elapsed and abort that loop through a global when you need to do so. A tiny bit of programming and thinking but an absolutely fail safe solution that depends nor on external code, nor on specific LabVIEW hidden or version dependant features.Rolf Kalbermatter Thanks for the suggestion. If I implement that option, I now find that the real problem occurs at the VISA Write. It seems like the general timeout value I apply to the VISA session does not apply to the VISA Write VI. I think another thing that might be making this difficult to troubleshoot is that I am using remote VISA calls i.e. visa://ip address/asrl2::instr. I'll have to see if the same problem occurs when I am on the local machine. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted November 16, 2006 Report Share Posted November 16, 2006 ... I now find that the real problem occurs at the VISA Write. ... "Now that is a horse of a different color!" (Wizard of OZ) Download the latest and greatset VISA drivers and try it again. See this thread on the NI forum where I said more and the user has reported improvement. http://forums.ni.com/ni/board/message?boar...=215294#M215294 Ben Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.