Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Wait on Event

If you want your data acquisition to run in parallel, you must represent this on your diagram.

LabVIEW is a dataflow language, so if you wire data from one icon to another, the first icon must complete before the second one begins.

In your case, you have wires going from the VISA Writes to the Wait to the VISA Write (for return), to a VISA Close, and then wires to your Data Acquisition loop. Thus, each of these functions is going to execute to completion before moving on to the next function.

You can always remove the data dependency between sections of your diagram to make them run in parallel. However, I'm wondering if you really just need to change the order of your functions.
..

Maybe, you need to remove the Wait (ms) function, and move the "Return" VISA Write and VISA Close after your data acquisition loop. I'm not sure what your program is trying to do. Are you wanting the Data Acquisition loop to run for three minutes and then "return" the motion control system?

I hope this helps.

Brian
0 Kudos
Message 11 of 13
(1,012 Views)
Not that this affects your application, but I misread the VISA reference manual. This function works on Windows as well as on other platforms when using the NI ENET-Serial devices. (I read it as only Windows and only when using ENET-Serial.)

In your case, you still want to use Wait (ms).

Brian
0 Kudos
Message 12 of 13
(1,012 Views)
There's a function called Wait+ (ms).vi which does exactly the function discussed above, of inserting a delay between operations, using the error wire to enforce execution order. If an error is present, the VI won't wait. It's found in vi.lib/daq/ctr.llb (unless this has changed in more recent versions of LV). The only thing to be aware of in using this VI is that it isn't re-entrant, which could cause problems if you use it in two parallel tasks, so I save a re-entrant version under a new name in my user.lib and use that one.

Another idea is to use a Wait on Notifier function with the desired timeout; the advantage here is that you can abort the wait (e.g. if you want to exit the program, or an error occurs elsewhere) by sending a notification.
0 Kudos
Message 13 of 13
(1,012 Views)