LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultanous Vi execution: one feeds in to another to stop it... help!

Hello,

I want to run two Vis in parallel, essentially a motor program will start and after 60 sec the motor will run. I want to simultaneously start another Vi that will be collecting current data. The idea is that once the motor program finishes it sends a true to the other Vi, which will stop the data collection loop inside that  program, save the data and stop running. It doesn't seem to work. Any ideas? I have attached the separate Vis and theyre compiled program idea for better clarity.

 

0 Kudos
Message 1 of 4
(2,678 Views)

You have to think dataflow.  You are creating a dependency on the lower VI that prevents it from starting until after the top VI has finished execution.  Nodes on a block diagram have to have all inputs available to them before they can be executed. 

 

There are several ways to solve this problem (notifiers and events, to name a couple). 

aputman
0 Kudos
Message 2 of 4
(2,670 Views)

HI aifrod,

 

1. This is not a good programming style. Sorry, this is a very bad programming style. And mybe that's the reason nobody wants to answer your question. But I will try to help you, as good as I can. Smiley Tongue

2. Because LabVIEW is controlled by dataflow, the "CHI_CA_x.vi" will be executed when data is present on all inputs. So it executes when the "1DScan.vi" stops.

3. Another program structure would be a good idea. You don't need two VIs running parallel.

4. ...but if you want to share data between to VIs you could use global variables or functional global variables.

 

Good luck!

0 Kudos
Message 3 of 4
(2,666 Views)

thanks...I am very new to LabVIEW and have to modify programs given to me so I am still learning

0 Kudos
Message 4 of 4
(2,656 Views)