LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The waveform chart in the tab control

Solved!
Go to solution

Hi,

 

I'd like to change the plot number and the plot name of a waveform chart in a tab control.

First of all, it works fine without a tab control, but I have many charts(such as temperature, pressure, voltage...) so that I put each chart into the pages of a tab control.

Error 1077 happened when I "add" the plot number and change the plot name.

The following is a sample I made to describe this problem.

PlotLegendInTab.png

 

Let's begin if the number is 20, so there are 20 plots in that chart in page 2.

20150526001.png

 

Do not turn on the switch, change C to 3, minus N to 18, and run it and it can be seen that the tab control will switch to page1.

Switch to page 2, and the plot names are updated but left some relic.

20150526002.png

 

Add N to 22, change C  to 2, and run it again.

Error 1077 happened! Switch to page 2, and the plot number is still 20, and the plot names are updated to 20.

20150526003.png 

20150526004.png

 

 

Run it again, and it works fine!

20150526005.png

 

It is very tricky for me.

If I switch to the page 2 first and run the program, it works fine too.

(That is, if the switch is turn on, then the program works fine.) 

The LabVIEW version of mine is 2011.

I'm not sure I missed or misunderstanded something about this problem.

Does someone can give me some suggestion? Thanks a lot:)

 

 

0 Kudos
Message 1 of 9
(4,984 Views)
Solution
Accepted by topic author William1225
Step 1: Don't use tabs, use subpanels. You can get the same user experience but with far simpler code.

Start here: http://www.notatamelion.com/2015/02/09/building-a-subpanel-based-user-interface/

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 9
(4,969 Views)

One of the problems I have is figuring out what it is that you are trying to do!  What is the purpose of the Tab control?  There is only one Waveform Chart, and it is only on a single page, so what is the purpose of the other pages?  You have three controls, "Switch", "C", and "N" -- what is their purpose?  I suppose one could try to deduce it from the code, but what about the poor User (who presumably does not know LabVIEW) confronted with this Front Panel?

 

[I have a colleague with a VI having a dozen or more Tab controls, with each Tab having at least a half-dozen graphs.  I go crazy when I see this routine -- you shouldn't want to see the Block Diagram!].

 

Bob Schor

Message 3 of 9
(4,923 Views)

Hi, mikeporter,

 

Thanks very much to your suggestion.

That's sound it is not recommended to utilize the tab control.

Are there any drawbacks or problems when the tab control is implemented?

(Previously I thought it is convinient to arrange the UI elements and to present to the user)

 

I'll study your elaborate article, and glad to know these useful material, thanks a lot:)

 

0 Kudos
Message 4 of 9
(4,899 Views)

Hi, Bob_Schor,

 

I'm sorry my poor expression confused you.

All I want is to demonstrate that the chart in the 'hidden' page of the tab control results in the error when the user tried to add plot number and change the plot name.

To make a scenario more specific, there is two pages in a tab control, one is for setting, the other is for the plotting.

20150527001.PNG

20150527002.PNG

 

When the user change the channel configuration, the chart is going to change correspondingly.

If I'd like to change the plot number and plot names, there is possiby a problem when staying in the setting page.

I hope I do not mislead you to the wrong directionSmiley Mad

 

You're right I should make the parameters more clear to facilitate reader understand my purpose easily.

Switch True means switch to the chart page before the modification of the chart, and return to the first page after the modification. Switch False means stay in the first page while the chart is modified.

C is used to make the plot name different among each execution. If the plot names of the chart in the previous execution are [101, 102, 103, 104, 105], and I'd like to decrease the plot names to three items [101, 102, 103], but in the case of the false switch, it will be [101, 102, 103, 104, 105], it is hard to tell if it is really updated. I can change C to 2, and the plot names in this execution will be [201, 202, 203, 104, 105], it could be shown it is updated indeed but left some unexpected plot names[104, 105](I call it relic...).

N is just the plot number the user can increase or decrease it.

 

I'm afraid of being the guy you mentioned...

Like my original post, I probably have several charts to show their results(temperature, pressure, voltage...) so that I make a tab control of 6 pages, and put a chart in each page. The user can also determine the channel numbers of each kind of measurement before the acquisition. I didn't think too much about it(actually now I still have this direct simple idea only...), what would you do if you have to show these data? Very thanks to your reply:)

 

 

 

0 Kudos
Message 5 of 9
(4,882 Views)

Don't worry, you aren't my colleague with the multiple plots.  He deliberately buys very large screen monitors (a pair of them), then proceeds to write Block Diagrams that are bigger than both put together!

 

I started writing some ideas, and then realized that this was just a bit trickier than I first thought.  The problem is that you have an on-going evolving piece of code updating your chart, and you want to make modifications to it "on the fly".  I've successfully done this, but it hasn't always been elegant.  I'm now thinking about how to do this in an elegant manner, and some non-trivial data structures are turning themselves over in my head (including an Event-driven State Machine).

 

I'm going to cogitate a bit -- maybe some other Forum readers have more direct experience or simpler models than what I am considering ...

 

Bob Schor

Message 6 of 9
(4,851 Views)
The biggest problem with tab controls is that while they may help organize the front panel, they do nothing for the block diagram.

Say you have a tab control with 5 tabs and 10 controls or indicators on each tab. On the block diagram you have 50 ungrouped and unorganized terminals that you have to deal with. Things can get very messy, and very complicated, very fast.

In addition tab controls have a long history of causing update problems -- especially with charts and graphs.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 9
(4,839 Views)

Hi, Bob_Schor,

 

Very thanks to your help, how does you solve this problem.

It is fine for me to get the solution even without the elegant manner:)

0 Kudos
Message 8 of 9
(4,764 Views)

Hi mikeporter,

 

Appreciated to your elucidation, it's helpful.

And I think I should start here: http://www.notatamelion.com/2015/02/02/modularization-its-not-just-for-block-diagrams-any-more/

0 Kudos
Message 9 of 9
(4,752 Views)