LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing data from a subvi to the top level with continuously running loops

Solved!
Go to solution

...in saying that, of course, you don't really need the while loops in the main vi - this really depends on the rest of your code and how you wish to run it. You can easily implement your error lines to run the vis in parallel: same input error line connected to the input error for both hardware vi and gps_etc vis.

 

BUT! if you want to keep running the hardware vi while you run the gps etc stuff and continue onto something else, you need to keep track on what's going on with the hardware vi - such as, what happens if there is an error, does the entire program come to a halt; does something change how it runs, etc. A notifier as Nathan suggested or another type of 'interrupt' will need to be implemented.

0 Kudos
Message 21 of 27
(1,200 Views)

thanks for your replies. 

 

The hardware vi needs to run before the display vis as there are events generated in the hardware vis that the display vis register for. I tried putting it in a sequence structure with no error lines etc but that also didnt work. 

 

moving the loops up to the top level would most likely work, but i really dont want to do this becasue this is just the start of a much larger project and i want to try and keep as much as possible out of the top level vi if i can. 

 

I think one of the reasons i am getting so confused is i am updating a current project that does basically what i am doing, but calls the underlying vis as references. i think this is unnecesary but maybe it allows all of the vis to think they are at the top level and it all runs ok, if that makes sense?

0 Kudos
Message 22 of 27
(1,184 Views)

bennymacca wrote:

The hardware vi needs to run before the display vis as there are events generated in the hardware vis that the display vis register for. I tried putting it in a sequence structure with no error lines etc but that also didnt work.


Right - because a sequence structure introduces a dependency where none exists through wires. Everything inside one frame of a sequence must terminate before the next step of the sequence runs - so if your first frame contains an ongoing loop, the next frame won't run until that loop exits.

 

You need to be clear about "needs to run before the display VIs" - do you mean needs to START running, or needs to FINISH running? Again, if you just need to make sure that it has STARTED, use one of the synchronization techniques.

 

You might find it helpful to put together some simple examples and run them with execution highlighting (the "light bulb" icon in the tool bar) so you can see the data moving along wires through your VI. That might help you understand the order in which LabVIEW executes VIs.


bennymacca wrote:

I think one of the reasons i am getting so confused is i am updating a current project that does basically what i am doing, but calls the underlying vis as references. i think this is unnecesary but maybe it allows all of the vis to think they are at the top level and it all runs ok, if that makes sense?


That's exactly what's happening. You are manually starting two the two VIs in some order, and they both run independently as top-level VIs. You can sort-of duplicate this in your main VI by simply dropping the two subVIs in your main VI, with no connections between them, and then wrapping the delayed-start one in a sequence structure with a wait in the first frame, but it would be MUCH better to use a notifier as I've already suggested.

0 Kudos
Message 23 of 27
(1,152 Views)

where is the best place for information on notifiers?

 

I might have to go back and redo that part of the online courses - any other useful information you can suggest?

 

Cheers

 

0 Kudos
Message 24 of 27
(1,136 Views)

@bennymacca wrote:

where is the best place for information on notifiers?


I would start with the help and the examples that ship with LabVIEW. There's probably information on them in the LabVIEW training materials and online courses as well.


bennymacca wrote:

any other useful information you can suggest?


Can you be a bit more specific?

0 Kudos
Message 25 of 27
(1,127 Views)

about notifiers, example vis are probably the way to go. 

 

 

0 Kudos
Message 26 of 27
(1,123 Views)

your greatest resource in regards to example vis is in LabVIEW itself. Go to:

 

Help >> Find Examples... >> Search Tab: enter "notifiers" >> double click on notifiers result = done!

 

Open 'Simple Notifiers.vi'. I believe this will help you with what you need.

0 Kudos
Message 27 of 27
(1,117 Views)