LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you view a sub-vi in code that has already executed more than once.

I have my main application, and it calls sub-vi's through out.  These sub-vis can be called multiple times with different parameters.  For instance a sub-vi is called "measure_sample.vi" amd my main application calls this VI multiple times for 5 different samples.  Then the main application is in an idle state that lets you view these results.  Is there a way that I can call the front panel of measure_sample for each of the 5 samples and show that in my main application?  Right now I can do this by storing away a picture of the front panel after each sample reading, but this takes up a lot of memory and seems like the wrong way to do it.
 
Thanks,
 
Brad
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 1 of 11
(3,478 Views)
A good start would be making the subVI re-entrant, so that multiple copies can exist in memory simulateously, but even then I'm not sure if that can do what you want.

Why don't you just wire the outputs of the subVI to terminals, and connect the terminals to indicators in the main application? Are you familiar with how to do this?
0 Kudos
Message 2 of 11
(3,469 Views)
The outputs of the Sub vi are not everything I am interested in.  There is also more sub-vi's besides measure_sample that have different on-screen results that I want displayed.  The results are also not ouput from the sub-vi, there are stored in a database.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 3 of 11
(3,465 Views)
I still don't get it... If the results are being displayed on-screen, should there not be some way to wire them up so that they are output by the subVI as well as stored in a database?

I mean, maybe you could wire the results up to a global variable and then read from the global variable in the main application instance following the subVI's execution, but that still amounts to the same thing in the end!

Message Edited by kehander on 01-18-2007 02:19 PM

0 Kudos
Message 4 of 11
(3,460 Views)
Maybe this will help...The main application does not know what sub-vi it is going to run, it is more of a test executer.  So it needs to be able to display any number of any kind of results.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 5 of 11
(3,454 Views)
So why not just display the front panel of the sub VIs that get called? Then the user can see the front panel with all the data when it runs. Am I missing something?
0 Kudos
Message 6 of 11
(3,451 Views)
Yes thats what I want to do is display the front panel as it runs.  But I want to be able to call back the front panel to view it after it ran, and that same sub vi can execute more than once, and I want to view the front panel from everytime it executes.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 7 of 11
(3,447 Views)
Then you need to set it to datalog to log that data from each execution. Then you can reload that data to view it. But beware this will accumulate data forever if you don't have some mechanism to clear it out.

-Scott

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 8 of 11
(3,446 Views)
How do you set it to datalog?
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 9 of 11
(3,435 Views)
Search the help for "datalog" for more info and possibly an example. The section is called "Logging Front Panel Data". But the quick answer is
Operate->Log at Completion

This will start the logging. You can bind this to a specific file for reading later or access it progamatically thru the front panel. Every time the VI completes when it is called the contents of the front panel are entered into a file. Instances of this data can be read back.


-Scott

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 10 of 11
(3,428 Views)