Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How Do I run multiple VIs at one time

Hello

 

I am having trouble running two sepaerate VIs (one DAQ and the other Vision) at the same time.

The DAQ displays data from 14 transducers and then stores them when required for a 10 second period. I want the vision to do the same thing, but only one will run at a time.

When I devide them into two seperate vis they work perfectly. I have been trying to understand using parallel vis not sure how to get started on that.

I have tried using two seperate timers instead of one for both vis both still only one will run.

I jsut got the Vision vi for the firewire camera working with help from the Vision side.

 

I am running Ver 8.6 and Vision ver 4.3.0 my DAQ is a PCI6220 on windows XP

 

Any solutions for this problem?

 

0 Kudos
Message 1 of 6
(2,596 Views)

The basic LabVIEW concept is dataflow and you have created a data dependency in the second loop by wiring the stop button to it. It will not start until all of it's inputs are there and of course when you stop the first loop (finally providing the data to the second), that will then stop the second.

0 Kudos
Message 2 of 6
(2,594 Views)

Dennis

 

I see how that happened, I moved the Imaq Grab into the While window and removed the 2nd stop.

I can now see the video and the Data in my display but I can not save the AVI until I stop the whole while loop.

 

I do not want to stop the data display part of the VI only the capture of the Data and the Imaq.

Do I need to add a different loop around the Imaq part of the VI

0 Kudos
Message 3 of 6
(2,565 Views)

Hi RAL1-

 

     If you want to be able to control the IMAQ loop iteration separately from the DAQ, they do need to be in separate while loops.  That way the IMAQ can iterate by itself when you stop the DAQ loop.

 

     I hope this helps.  Best of luck with your application!

Gary P.
Applications Engineer
National Instruments
Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 4 of 6
(2,527 Views)

Gary

 

What I am tiring to do is have one button to control the DAQ capture and the Video capture at the same time,each running 10 seconds and then stopping.

I started out just writing the DAQ and getting it running then started a new VI for the Video. Then when I tried to combine the two I get into the problem of one or the other running.

I have gotten the video to run or the DAQ to run but not both within the same while loop. I have tried using two timer one for each with no luck. The only way I was able to run the two VIs was to open two separate windows one for each VI. 

I am looking at examples for running parallel VI but not getting very far at this time.

Any ideas would help.

 

Richard

0 Kudos
Message 5 of 6
(2,514 Views)

Hi there Richard,

 

You may well have thought of this already, but have you considered using local variables when stopping multiple loops simultaneously?

Right clicking a control on the block diagram and choosing “create > local variable” allows you to place a sort of clone of the control without duplicating the control on the front panel. Right clicking the local variable you have just created, you can configure it to be a ‘read’ or ‘write’ item.

 

The attached picture is an example of using a local variable to stop two loops without causing data dependency as in your first case.

A few issues arise with local variables such as the ‘latch when...’ mechanical action of buttons cannot be used and over use of local variables open the door to race conditions. This said; using just the one local variable for a stop button shouldn’t cause you any problems.

 

As an aside:

 

In your code I see that you’ve wired up the error terminals for the IMAQ part of the code, but there isn’t a way to stop the loop running in the event of an error being present. Maybe consider using OR logic or ‘compound arithmetic’ code to connect this to the stop terminal of the loop along with the stop button. I would also recommend wiring up the error terminals for the DAQ part of the code with the same goal in mind.

Another thing I noticed is that your program would suit a producer-consumer design structure, where the DAQ assistant could queue up data for the consumer loop where all of the scaling code could then process.

This would likely require a major rebuild of your code, and there’s no need to fix that which is not broken, I just wanted to make the observation.

 

I hope that I’ve helped, and if any of my explanation is unclear then feel free to say so.

Best of luck with your application Richard!

Rhys
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(2,498 Views)