Jump to content

Quick VISA Question


bbean

Recommended Posts

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

Link to comment
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

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

Link to comment
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.

Link to comment
... 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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.