LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between VISA Sync. and Async. I/O?

I am relatively new to LabVIEW and GPIB and am running into some difficulties with what looks to be an inconsistent VI due to timing issues.

The problem seems to be related to either the VISA read or VISA write VIs. I noticed the option to make the VISA VIs sync. or async., but am not completely sure what this means. I am under the impression that sync. would be synchronized with the processor's clock while async. is not. This, however, would make me believe async. would be used for applications where a VISA I/O operation must take less than one clock cycle. This seems impossible to me since there are numerous GPIB functions to be executed from a single VISA I/O VI.

When I use async. I/O operations, I get tim
eouts showing in NI Spy when waiting for an IO completion event.

I have looked in many references provided by NI but cannot find specific information on the difference between these two functions. Can anyone help me? Anything would be appreciated.

Also, some other small questions contributing to my confusion. Again, any help is appreciated.

Why is the timeout in viWaitOnEvent() set to 0 (or am I mistaken)?
Why do the viEnableEvent() always return VI_SUCCESS_EN indicating the specified event is already enabled?

Thanks for the time,
Chris

PS. If you are interested in helping me and are unclear to some of the details, please post any questions and I will provide any extra info.
0 Kudos
Message 1 of 6
(4,678 Views)
I asked this question a while back.

The link to the discusion with "VISA Dan" follows

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000006D5D0000&UCATEGORY_0=_201_%24_13_&UCATEGORY_S=0

Warning, this is not light reading!

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(4,678 Views)
Chris:

Ben's link below to my other posting should help you some.

I wanted to do a post just to clear up what the terms synchronous and asynchronous mean in this context. I think you are coming at it from a hardware perspective, where the meanings are a little different.

In terms of software driver calls, synchronous I/O makes a call to the driver on a given thread, and that thread blocks in the driver until the I/O either completes or times out. Nothing else can occur on that thread of execution. If you have set LabVIEW to run in single-threaded mode (or if you are running on Mac OS 8/9) then this means that nothing else at all can happen in LabVIEW while that I/O call is going on.

An asynchronous call means that control can return to LabVIE
W while the I/O is ongoing. LabVIEW can do other nice things like update the GUI. Then it can poll the driver periodically to see if it is done. You see that happening with a timeout of 0 so that LabVIEW remains in control of what it wants to happen when.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
Message 3 of 6
(4,678 Views)
Thanks Dan, this helps.

Chris
0 Kudos
Message 4 of 6
(4,678 Views)
Ben- can you re-link this?

Ben wrote:
I asked this question a while back.

The link to the discusion with "VISA Dan" follows

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000006D5D000...

Warning, this is not light reading!

Ben

Thanks!


"Should be" isn't "Is" -Jay
Message 5 of 6
(4,041 Views)

Jeff Bohrer wrote:
Ben- can you re-link this?

Ben wrote:
I asked this question a while back.

The link to the discusion with "VISA Dan" follows

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000006D5D000...

Warning, this is not light reading!

Ben

Thanks!


Never mind Dan onlyhas about 350 posts and I found it here


"Should be" isn't "Is" -Jay
Message 6 of 6
(4,026 Views)