LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read indicators continuously from running subvi's

Solved!
Go to solution

Greetings,

 

Many earlier threads discussed this problem. However, seems like all of them need huge modifications to the subvi's.

 

Now, we have a bunch of subvi's programmed by different programmers, but at the end we find it difficult if we want to combine all the indicators in each subvi and display the values in the front panel of a single main vi, without big modification for each subvi.

 

Using control reference will be a solution, with some modification in the subvi's, but it seems like the main vi and subvi's need to run at the same time. We can not run only a subvi itself then.

 

Global variable is another resort, however, we have a huge amount of indicators, creating global variables for each indicator in each subvi seems like a redundant procedure.

'

I'm just wondering if there is a way to create a shell-liked main vi to read those indicators continuously without the need of touching the inside of each individual subvi. Or please advise if you have better ideas.

 

Thank you in advanced for any comment.

 

-chen

 

 

 

 

 

 

0 Kudos
Message 1 of 4
(2,354 Views)
Solution
Accepted by topic author thitchen007

I wasn't involved in any of this other discussions you mention so I can only go off what you have described in your post. So the questions I would ask are:

 

- Do the SubVIs continuously execute (called) until the application finishes?

- How do you stop the sub vis? Are you reliant on Front Panel controls (such as a Stop button)?

 

If you'd rather not touch the sub vis, you could put the sub vis into SubPanels in the main vi. This would allow you to expose their Front Panels, hosted in the main vi. Look up Sub Panels in the LabVIEW help or online. It would also expost their Controls too, but you could customise the Front Panel of each to hide these off screen, so to speak. There are also properties of a VI that allow you to programmtically re-locate to origin and re-size the Front Panels in order to guarantee the correct visual display.

 

If this doesn't work for you then I think you should take a hard look at your architecture. Sometimes you can only get so far by cobbling things together. Look closer at any mis-conceptions of what a VI actually is and what calling a VI within another VI actually means (you are basically calling a function with a few added extras like a Front Panel). There are ways and means of programatically obtaining what you want, but they are hard work, not very maintainable and may be more effort than alternatives.

 

My strategy of choice? Use a messaging scheme of some kind to communicate between your objects in your system. You have your objects (Main UI, each Sub VI is a little entity of work independent of the others) and you can use one of the constructs available to you in the base LabVIEW framework (Notifiers, Queues, User Events, Global Variables (yuck), FGVs etc.) to allow those objects to communicate to each other. 

 

But I'm guessing you've heard all this before. All I can say is "they are right". Sometimes there is no better solution for poor design than to re-design.

Message 2 of 4
(2,344 Views)

tyk,

 

Thank you so much for the detailed explanation.

At the end, we turned to the "Subpanel". It works nice.

Next is to write all the readings into a single file.

Thanks again, Kudos to you!

 

-chen

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

try looking at passing references....

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