LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subpanel dynamic vi loading very slow switching between subVIs

Hello,

 

i have an application very similar to 

https://decibel.ni.com/content/docs/DOC-29127

 

seletion buttons on the left and i pass that boolean text to open a subvi with same name inside a subpanel on the right.

i have a total of 12 buttons on the left coresponding to 12 subvis that i open inside the subpanel. each subvi has multiple tabs with graphs and some event cases to handle graph manipulations for better analysis like zoming or scrolling for data analysis.

 

it funtions well, no problems but when i switch between the subVIs using the buttons on the left, it takes very long to display the next one in subpanel and it slows down the UI. is there a better way to switch between subVI's very fast.

 

after reading through the forums i came across this, where few user's response to "calling by reference" sounded like a bad idea except in few cases

http://forums.ni.com/t5/LabVIEW/calling-by-reference-dialog/m-p/2294420/highlight/true#M723266

 

Theoretically you probably could run everything in the program dynamically. The problem is execution speed. Before every call, LV would have to load into memory the code you want to execute, and then after every call deallocate the memory associated with it - this would make any non-trivial program very, very, very slow   

and

Seriously, calling everything dynamically would be a terrible idea. On modern machines there's plenty of RAM and processors are fast but disk drives are slow, so having to constantly load subVIs off disk would slow your program enormously. 

 

i am concerned about the execution speed of switching vis, these subVIs take in atleast 20 files each of which has a mimimum 10000 rows and 100 colums data array that is extracted/ caclulated and displayed in the graphs..

 

i was thinking of running these subVIs as modal VIs instead of in subpanel so the user has to close it to go to next button on main VI. and i could set them to open right next to the main VI using bounds property but the border on the subVI's FP looks ugly and looks like two diferent VIs instead of looking like the subpanel nicely integrated into main VI.

subvi docked to main vi.png

is there a way to get rid of the subVI border 4pixel or is the subpanel way to go as described in the first link or is there a better method to handle this?

 

what will be a beter way to architect my code so its scalable, these subVIs will be more in the future

 

any help is appeciated.

Thanks

0 Kudos
Message 1 of 3
(3,952 Views)

I would definitely say that subpanels are the way to go with this.

 

Is the intention that only one of the 12 Sub VIs will be running at a time or are they all running and you just want to display one of them at a time? If it's the first as I suspect, you can save having to load the VIs from disk by using Static VI references which loads them from memory instead of from disk (static versus dynamic launching) or load them into memory (open VI reference) at the start of the application and then just run them (call asynchronously). Either way, you'll need to keep track of the VI references so you can insert/remove them from the subpanel.

 

I'm working on an application where the entire user interface works by loading different VIs into subpanels when the user changes a tab control. Moving the VIs into/out of the subpanels happens so quickly I don't notice it. I therefore suspect that your issue might be something to do with how you are launching/switching things into/out of the subpanel or in your actual code itself. If you post it up then maybe we can have a look.

 

As for the other way you were thinking of doing it - you *can* hide the border of VI windows but doing so will hide the title bar as well if I remember correctly. 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 3
(3,931 Views)

I second Sam on this...

 

For UI switching I have used sub panels with no problem. In some ways they are better than using tabs because (a) it reudces the complexity of the main vi considerably (b) you can resize controls and splitters in a sub-panel vi which you can't do in tabs, and (c) the sub-panels are re-usable (eg. I have a drop in chart panel with a host of zoom, scroll, and cursor functions). I love 'em!

 

I have run into problem swapping between them, but in that case the problem was in closing the current panel before loading the new one. If the sub-panel vi is slow in closing then it can wreak havoc, so watch out for this.

 

Regarding the quotes on dynamic calls slowing things down, if you replaced all your sub-vis with dynamic vis then this would likely be an issue, but since UI sub-panels are generally only switched out every now and then, a few ms here or there should not be a problem.

0 Kudos
Message 3 of 3
(3,922 Views)