LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I implement multi page display

Solved!
Go to solution

@AndyNC wrote:

 

My problem is how to "create a typedef of the tab control". I already have a typedef for the program which I would like to use and would like to "create a tab control from a typedef" if thats possible.


If you have already created a type def for the tab, just drag and drop it from the project explorer onto your front panel 🙂

 

For now, just make it an indicator and wire a constant to it. Experiment with adding pages in the typedef and see the new values appear in the block diagram constant.

For your application, change it back to a control and right click->create local variable. Write to the local variable to force a page change on the control.

For ease of maintenance, try to encapsulate the action to only a few locations (e.g. in a state machine). This will also encourage good architecture design

_____________________________
- Cheers, Ed
0 Kudos
Message 11 of 21
(2,561 Views)

Sorry but I'm still having problems.

 

I can do virtually all you suggest. ie I create a constant to control the tabs. This gives a choice of the two tabs I currently have in the control. But I get "wire enumeration conflict" errors if I connect a local variable of my application states to the tab control.

 

I only want tabs for some of the states. I've created two tabs in the control, both textually match the application states but I still need some way of tying the application states type to the tab control type.

 

Any ideas.

 

 

Cheers

 

Andy

 

0 Kudos
Message 12 of 21
(2,554 Views)

you have to have a case structure between your state an the tab like the first example

0 Kudos
Message 13 of 21
(2,550 Views)

Hi,

 

I'm progressing.

 

I had to type convert the state to a number to get it to work. In the example given, the tab selection is through a number and not a state. This causes extra work in that the tab order must match the state enum order.

 

Although this works it's not as elegant as I would like. Is there an example where only states and enums are used.

 

Thanks

 

Andy

0 Kudos
Message 14 of 21
(2,537 Views)

You are getting an enumeration error, because your 2 datatypes do not match. you may have updated the typedef, but are trying to write a non-typedef constant to it. Or vice-versa. Hopefully these images should clarify:

 

Create your typedef

 

 Create Typedef.png

 

Drop your typedef on your VI and create a local

Notice the black triangle in the top left, which indicates a typedef control. The local variable does not have this....yet

 

Drop Typedef.png

 

Go back to the typedef and make a change

 

Edit Typedef.png

 

All instances of the typedef will update themselves, and won't create enumeration errors

 

Updated.png

_____________________________
- Cheers, Ed
Download All
Message 15 of 21
(2,528 Views)
Solution
Accepted by topic author AndyNC

Hi,

 

Got back to this after a visitor.

 

What you showed me works but it causes a problem when I don't want all tabs shown. ie I only want 4 out of a possible 7 states to have tabs. This is where my mismatch is coming from.

 

From this I think I'm best off re-ordering my application typedef so that the first 4 are the ones to use and creating the tabs to match.

 

Many thanks

 

Andy

0 Kudos
Message 16 of 21
(2,512 Views)

@AndyNC wrote:

 

What you showed me works but it causes a problem when I don't want all tabs shown. ie I only want 4 out of a possible 7 states to have tabs. This is where my mismatch is coming from.


From your description, am I right that you have a state machine with 7 states, and 4 of those states have a page on a tab control which can be used for configuration, 

Or do you mean you have a tab control with 7 tabs, but you only want 4 of those tabs to be shown?

_____________________________
- Cheers, Ed
0 Kudos
Message 17 of 21
(2,496 Views)

@AndyNC wrote:

I only want 4 out of a possible 7 states to have tabs. 


I not sure just what the visual effect you are looking for, but Tabs are just like enum. They have to be defined at compile time and can not be changed during run time. But you can change which tabs are visible (4 out of a possible 7) by getting an array of references to the pages of the tab control and then setting the Page Visible state of each page as you wish.

 

tab control.png

 

You can't change the Tab Label at run time but you can change the tab Caption at run time.

Check out the Page Property Node "Independent Label"

Omar
0 Kudos
Message 18 of 21
(2,490 Views)

Hi,

 

Ed and Omar: I have a state machine with 7 states and I want a tab control with 5 ( I recounted) tabs. Basically the tab enum will be a subset of the state machine enum.

What I would like to happen is the following:

The state machine will run in idle until a button is clicked.

The state machine will change to the selected state and the tab control will change to the tab that matches the state machine state.

When the state machine state has completed it will drop back into the idle state and I would like the last tab to remain active (in focus?) so the results of the last state machine state are left visible.

When another button is clicked the tab will change and stay active after the state machine state has completed.

 

But having said all this I had another idea last night. It would probable easier to create a tab control for the functions I require and place the buttons on their corresponding tabs. The user will select the tab and then click the button for that function. The results will be displayed on the tab which will not change except by user interaction.

I will try this method because it is much easier (for me) to understand.

 

Many thanks for your support I have a learned a lot from you guys.

Just to least you know I'm on Core one coarse next week. I hope I'll learn a lot more there as well.

 

Cheers

 

Andy

 

 

0 Kudos
Message 19 of 21
(2,475 Views)

Would you want the code for each tab page to run when the tab control page is switched by the user?

 

Or would you want the user to be able to switch betwen the pages to review results and only run the code for that page from a button click?

 

Note: the Run and Stop buttons are "floating" above the tab control and are not on or in the tab control.

Omar
Download All
0 Kudos
Message 20 of 21
(2,463 Views)