09-23-2019 07:49 AM
@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,...
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
09-24-2019 10:52 AM
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.
09-24-2019 11:51 AM
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
09-24-2019 09:40 PM
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
09-25-2019 12:04 AM
@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)
09-25-2019 11:18 AM
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 subpanels
Chart Loop
09-25-2019 12:06 PM
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.
09-25-2019 12:17 PM
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.
09-25-2019 12:47 PM
Check;
Properties >>> Execution
of the inserted VI and verify the "Non-Reentrent" is NOT selected.
Ben
09-25-2019 12:50 PM
@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