LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Top level VI execution control... what am I missing?

Solved!
Go to solution

Hello all-

I'm writing an app that has front panel controls to access either calibration or collection routines from two subsets of channels on my DAQ hardware (USB-6211)... called Bank A and Bank B.  The problem is that once I have called any one of those subVIs, I lose the ability to call another from the main user interface... at least until the first call has completed its task and returns control to the main VI.  

For example, say I am collecting data on Bank A and would like to independently calibrate or collect on Bank B in parallel, it qeues subsequent front panel button presses until the first task is complete.

 

I feel I must be missing something pretty fundamental here.  Perhaps it has to do with the execution system selected or improper top-level design?  Is the Event structure I'm using fouling things up?

 

Because the 6211 won't allow me to read the analog-ins of one subsets of channels while the other subset is busy acquiring data, I am attempting to read all 16 channels once per second (averaging values over about half a second), then feed that data array into these subVIs for display or recording.  I need the DAQvoltagesAverage VI to execute continuously in the background, updating the array every second for use in the other routines.

Am I way off here?  

 

Any and all help greatly appreciated!  I have everything downstream working, but haven't been able to figure out this top level issue.

 

Using LabVIEW 2011 on MacOSX

 

 

0 Kudos
Message 1 of 3
(2,025 Views)
Solution
Accepted by RobertDH

The event structure does not complete until the VI in it has completed. In addition, you are locking thre front panel in the event configuration. The main program will stall until the subVI is done in your implementation.

 

There are plenty of way to lauch independent VIs, for example using VI server or "start asynchronous call", for example. You could even use two independent while loops and event structures for each.

 

(What is the purpose of the 1s wait. seems useless here.)

Message 2 of 3
(2,018 Views)

altenbach... Thanks!

I knew it was something fundamental I had wrong.  How I got this far without understanding why one might need vi server or asynchronous calls is beyond me.  So, I ended up moving the DAQ vi into a separate loop and passing the data in with a global variable (WORM to avoid races), and calling the subvis with invoke nodes.

 

I did need a Wait function due to timing issues, but it was in the wrong place... moved into the DAQ vi.

On a side note, it would have been nice if DAQmx were supported on OS X, rather than only DAQmxBase... could have used timed loops in an earlier version.

 

Thanks again!

0 Kudos
Message 3 of 3
(1,984 Views)