LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subpanels, Waveform Charts, Async VIs

Solved!
Go to solution

@JÞB wrote:

...

Tab containers are hateful 


I am not sure what about tabs left you with a sour taste, but they work OK for me.

 

Sure, in the early days there were issues with charts on hidden pages not updating as expected. I recall having to implement "jiggle the handle" type code to ensure the charts updated. But it has been years since I ran into those types of issues and I DO use tab with and without charts in many if not all of my applications.

 

Now when I have to develop for novice customers to support the code I deliver and "writing to my audience", I find tab controls easier for them to grasp than sub-panels.

 

So for what it is worth,...

 

 

Spoiler

Before the tab control was introduced... problably LV 5.1 or so I found myself implementing a very complex GUI that required hiding and showing groups of controls and indicators. Lacking the tab control the code was dominated by attribute nodes since the "grouping" of controls and indicators that we gain from tab controls was not available. Now since it was in LV 5.1, there was no option to use control refs and sub-VIs to handle the visibility, it all had to be done in the top-level! With all of that code just to handle the look and feel it was difficult to find what code actually did anything!

 

While I can not be sure, I suspect that code is one of the examples that NI trots out as bad code. While it may be unfair showing code developed for LV 5.1 and presenting it as bad code in the world of property nodes and ActiveX, it does give one an opportunity to appreciate control refs and tab controls. 

 

 

 

I still use tab controls.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 24
(1,592 Views)

Some great thoughts and ideas, thank you!

 

So I have changed my top level VI to a single subpanel with some buttons and an event structure to decide which VI will be swapped into view.  While it is a good improvement to my overall program, waveform charts still start plotting from scratch when a VI is inserted into the subpanel.  My guess is that if you don't have a physical view of the VI, it won't update the chart.  I am considering having 4 subpanels stacked on top of each other and 3 of them hidden at a time.

0 Kudos
Message 12 of 24
(1,555 Views)

Old versions of LV had issues with the chart if not viewed.

 

I believe you have ruled out the tab control as a suspect so we should now question the VI you are inserting in the sub-panel is the culprit.

 

Dumb down the inserted sub-VI as much as you can (while preserving the questionable behavior) and share that with us so that we can take a look since (inquiring minds) want to know about problems before we stumble over them ourselves.

 

Share the inserted sub-VI.

 

Note:

Without you sharing an example of the issue, I do not suspect there is much we can do to help.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 13 of 24
(1,546 Views)

So I have changed my top level VI to a single subpanel with some buttons and an event structure to decide which VI will be swapped into view.  While it is a good improvement to my overall program, waveform charts still start plotting from scratch when a VI is inserted into the subpanel.  My guess is that if you don't have a physical view of the VI, it won't update the chart.  I am considering having 4 subpanels stacked on top of each other and 3 of them hidden at a time.

I can definitely state that this is not the case.  I have a routine with multiple independent processes producing graphs on their Front Panels.  As they are running as sub-VI, none of these Graphs are visible, but by pushing a (Radio) button, I can insert any of them into my Main VI's sub-Panel, and see the (evolving) Graph.  I'm using a Graph rather than a Chart, but I'm 99.44% certain I could build a demo that does this with Charts, as well (if you'd like me to try, send an encouraging Reply and I'll give it a shot tomorrow).  So if it isn't working for you, the problem (probably) likes in your sub-VI that you are inserting into the sub-Panel.  Attach it to your Reply and I'll bet one of us can make some helpful suggestions ...

 

Bob Schor

0 Kudos
Message 14 of 24
(1,514 Views)

@Ben wrote:

Old versions of LV had issues with the chart if not viewed.

 

I believe you have ruled out the tab control as a suspect so we should now question the VI you are inserting in the sub-panel is the culprit.

 

Dumb down the inserted sub-VI as much as you can (while preserving the questionable behavior) and share that with us so that we can take a look since (inquiring minds) want to know about problems before we stumble over them ourselves.

 

Share the inserted sub-VI.

 

Note:

Without you sharing an example of the issue, I do not suspect there is much we can do to help.

 

Ben 


I thought I said that last week.  We reallly can't debug code that we cannot see!

 

( I am still betting on a panel activation event.... but my magic 8-Ball is located on my desk in North America while I am in Europe)


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 24
(1,505 Views)

Current situation:

- I have 4 stacked subpanels with an async instance of my subVI inserted in each one.

- 3 of the subpanels are invisible at a time.

- When I switch away from a subpanel and come back to it, it does not re-plot the data anymore, BUT there is a blank space in the plot for the time it was not visible!

 

Questions:

1. What is a panel activation event?

2. If all 4 stacked subpanels are visible, can I programatically bring one subpanel to the front or move the other 3 out of the screen?

 

Finally, my top level VI and the plotting loop in the subVI:

Top Level.  The other events just hide/unhide subpanelsTop Level. The other events just hide/unhide subpanelsChart LoopChart Loop

0 Kudos
Message 16 of 24
(1,484 Views)

I know this isn't exactly the point of this thread, but why have multiple hidden subpanels?

You could simplify your code by having just a single subpanel and an array of references, then choosing which VI reference to insert to the subpanel (from the array formed by the async running copies) using whichever method you liked.


GCentral
0 Kudos
Message 17 of 24
(1,474 Views)

I have tried that.  When I remove a VI and load a different one into the subpanel, the waveform chart in that VI restarts the plot.

0 Kudos
Message 18 of 24
(1,467 Views)

Check;

 

Properties >>> Execution

 

of the inserted VI and verify the "Non-Reentrent" is NOT selected.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 19 of 24
(1,460 Views)

@Ben wrote:

Check;

 

Properties >>> Execution

 

of the inserted VI and verify the "Non-Reentrent" is NOT selected.

 

Ben


Another thing to try: Disable the subpanel control, set the VI to open the front panel when called, that way you have a bunch of windows open. Are all of the plot window updating properly? If not, then look into settings, controls, etc.

 

mcduff

Message 20 of 24
(1,456 Views)