12-11-2013 10:52 AM
Hi all,
So I'd like to preface this saying that I am new to labview and the code I have posted was built in large part due to the help of a postdoc in my lab. But here is a breakdown of what I am trying to do:
1.Sample 5 voltage channels view them on a waveform graph and record the total time of acquisition.
2.Pause the Acquisition and stop the timer untill I click Resume
2a. During this time I would like to run a separate VI which will plot the waveform graphs but will not Acquire Data.(the motivation behind this is that sometimes we wish to stop acqurining to get an idea of what is going on in our optical system, fix it, then continue data acquisition.)
2b. Upon clicking "Resume" in the main VI(Dec9_FlowCyt) I want the subVI to stop, I want my timer to be correct, and I want to resume data Acquisition.
Tha main problem that I am having right now is that when I click Resume it does not stop the SubVI, does anybody have any ideas of why this is happening and how I can make it work?
Best,
-Joe
12-12-2013
01:48 PM
- last edited on
11-18-2025
12:38 PM
by
Content Cleaner
Hi Joe,
At a very high level, It may be beneficial to use state machines (https://www.ni.com/en/support/documentation/supplemental/16/simple-state-machine-template-documentat...) with possible Start, Pause, Resume State.
With the use of that structure, you could define your SubVI to stop once it enters the Resume State.
12-12-2013 02:03 PM
MJ,
Thanks for your reply. I will take a look at the article and see If I can adapt my VI to use this strategy, thanks!
-Joe
12-12-2013 08:13 PM
It looks like the issue you are running into is the fact that the subvi is not being controlled by the main vi. The subvi begins operating with the parameters you supply to it. So unless resume is TRUE when the subvi begins the subvi will run until you press stop in that subvi. If you have resume as true when the subvi begins then the subvi would run once and then stop. A simple state machine architecture like suggested would help alleviate the problem. Now to address the question at hand, I went ahead and attached a program that would communicate between two vi's. Notifiers are an easy way and a functional global variable (FGV) is easy as well. I would recommend the FGV way for beginners. It utilizes an uninitialized shift register to pass values on. It is a pretty valuable method to transfer variables from place to place without using local variables.
- Run myMainLoop first and it should bring up the second loop. Hope this helps.
-Kyle