LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Neil.Pate

Tab control enum to be typedef rather than plain enum

Status: New

Another suggestion, which would be nice.

 

When you have a tab control and create an enum from it to use in the BD, it is not dynamically linked to the original tab control. In other words if you add or remove a page the enum on the BD is not valid anymore, but is not actually broken as its just a plain vanilla enum.

 

If the enum created from a tab control was a typedef then it would automatically update if the tab pages are modified.

A work around is to have the tab control as a typedef itself (actually I have just thought of this, don't know why it never occurred to me before!) but I would still like the modified behaviour as its one less typedef I have to manage myself!

 

<INSERT FANCY PICTURE HERE TO GET EVERYONE'S ATTENTION>

 

 

6 Comments
shb
Active Participant
Active Participant

I do not like a typedef Tab control. When I want to pass it to a SubVI it is a Tab control, but an enumeration would look nicer. Then I make the Tab control Strict, I must change the size in the Typedef (and in the SubVIs or in other instances the size is the same). And when don't make it strict, the size is taken from the typedef after inserting a page. And inserting or deleting a page is very unpractical. As long as I do it in the end, it is OK. But when it is in the middle, the controls stay on the page with the same index and not on the one with the same label.

No question, something should be done here.

 

That a typedef could be defined on the front panel (or linked to a FP control) is a nice idea anyway.

 

 

 

At least some parts of this could be automated by an add-on (in Menu, RFC, Quickdrop). The add-on could do (at least one of this things):

- update all connected enumerations

- replace all connected enumerations with a typedef

- update the typedef enumeration

 

All connected enumerations means those connected directly or by a longer path. And they can be connected to the terminal, to a local variable or to a value (or value signaling) property.

The third point looks like the simplest to implement. The typedef could be manually chosen in a first step.

 

 

shb
Active Participant
Active Participant

The same idea is posted here, but this one is older.

AristosQueue (NI)
NI Employee (retired)

The idea has merit, though I suspect there's a reason why the Tab Control was disallowed from the Control Editor in the first place. I do not know that reason -- I'll flag this thread for one of the developers and see if they post details. 

 

I will mention one other (probably better) workaround. Create a plain typedef enum. Drop your tab control. Wire the output of the tab's FPTerminal to a Type Cast primitive and convert the value of the Tab into the typedef'd enum. Then use the typedef'd enum everywhere on your diagram. When you add a tab, you have two items to fix -- the tab control and the typedef'd enum -- but that is almost certainly fewer than the total number you'd have to fix up if you don't use the typedef at all.

Christy
Member

The Tab Control IS allowed in the Control Editor.  The comments about the behavior of the typedef that some folks don't like is valid criticism. The best answer that I could give in response is that is the way that we implemented it and though people would like to use it  (and also the typedef behavior is linked to the replace behavior which puts some limitations on it).  This is something that we could look at for a future version, I don't think that I have heard this particular feedback in regard to the tab control before.

X.
Trusted Enthusiast
Trusted Enthusiast

the alternative option described by nrp is buggy, as discussed here, so in practice, it is NOT an option. I think I would prefer to have the original suggestion working.

AG@Amfax
Member

I am in complete agreement with nrp and X, when a Tab Control is changed to a a strict type def surely the enum control should also be!! I would strongly advise this to be implmented in future versions of LV as it can be a real pain!! A further suggestion would be to allow for other controls to be placed within the pages of your custom control tab, as I have found that removing and reodering pages within my typedef tab can cause real problems in the code (especially as im programatically changing tabs using events)!

Regards

Andy
_______________________________________

"To 'G' and not to 'C', this is not a question!"