LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My sub-VI doesnt work unless it is open

Solved!
Go to solution

I'm working on a simple data analysis program for a 32 channel acquisition system that runs at 2kHz. Before opening the >50MB .csv files, I'd like to graph them to see what was going on in each channel, on one graph (i.e. 32 series plotted together).  I made a sub VI that gets passed a file and graphs this. I've tried it with a constant file path, and it works fine.

 

The problem is, I have a "master program" which calls this sub VI to graph all the files it identifies. In the master program I have an array of files that need to be analyzed. I pass this into a FOR loop, autoindexed. In all of my other Labview programming instances, the master program runs fine and executes the subVI. But in this particular case, it doesn't. I can see that it takes the same amount of time per loop as it should (for example, about 5 seconds per file), but it does not output the actual files UNLESS THE SUBVI IS OPEN IN ANOTHER LABVIEW WINDOW. The front panel for the subVI is all that's needed for it to execute correctly. When I have both front panels open, and I run the master program, it outputs the correct graphs as .bmp's in the right folder. But it doesn't output anything when the subVI is not open.

 

Quite confused... not sure what could be causing this... LabView2011 Student Ed.

Thanks in advance!

Download All
0 Kudos
Message 1 of 7
(1,816 Views)

This is a known limitation.

 

If the front panel is not open, LabVIEW will not update the front panel to save resources. You can set the subVI to e.g. open minimized and things should work just fine.

 

(btw, aren't your explicit and complicated array operations just a transpose?)


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 2 of 7
(1,805 Views)

I think the problem is that LabVIEW has outsmarted itself in this case. Because updating large graphs takes much CPU resources, memory, and time, LV does not do the calculations required if the panel is not visible.  If the indicator (graph) is not updated, then Export Image does not do what you want.

 

Search the Forum for "export image" to find more information. Basically you need to have the front panel open. It may be possible to move it off screen or behind something else where it does not show. I have not tried this so I am not sure which combinations work.

 

Lynn

0 Kudos
Message 3 of 7
(1,791 Views)

OK, that makes sense. So I see that I can make an invoke node (from VI server reference set to "This VI") -> front panel -> run time position -> minimized. I put that in the subVI. And when I have it open and run the master program, I can see that it minimizes itself...

 

But how exactly do I get the sub VI to "open" when I wire something to it though? The Open VI reference.... confused here. Definitely a LabView newbie.... 😞

Message 4 of 7
(1,768 Views)
Solution
Accepted by topic author Cowbell

Just go to the subVI and change the following properties (file..vi properties):

 

Uder Windows apperance...customize: set it to "show front panel when called" and "close afterwards..."

Under Windows Run-time Position: Set position to "minimized".


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 5 of 7
(1,755 Views)

Ahhh it was under customize! Thanks so much. Works fine now!

 

0 Kudos
Message 6 of 7
(1,751 Views)

FP.State can be writen programatically at run time and from the main vi.  just pass in a control with "Hidden" from the caller and "Standard" as the default value. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(1,702 Views)