LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strict Type Def with Menu Ring does not automatically update linked constants

I have a strict Type def with a menu ring control. When I add items to the menu ring within the control editor the apply and save the strict type def the constants that are supposed to be automatically linked to update do not do reflect the new additions.
0 Kudos
Message 1 of 4
(3,490 Views)
Hi TommyB,

I believe the short answer is "Correct!".

How I understand it:
The displayed vaues are not associated with the data coming from a "Menu Ring". On the other hand, an enum does!

Quick experiment:

1) Create a new VI and drop a Menu Ring and a Enum on the front panel.
2) Customize both, giving them a short list to start (1.e. a,b,c) and save them both as typedefs.
3) Back in your new VI pop-up on both controls and create indicators.
4) Goto the wiring tool and do a "ctrl-h" (show help) and then position the wiring tool over the wire and observe the help window.

You will see that the enum wire knows about the strings assigned to the numeric values. This is not the case with a Menu Ring.

Additional experiment:
5) Customize both of you
r controls created earlier and do a "save as..." with the "save without updating callers" option set, after making small changes to the list.
6) Drop these new typedef'd controls on the VI FP and try wiring them up. The Menu Ring will not complain. The Enums will (provided they are different). I will take advantage of this fact in my code by using enums to ensure I do not miss changing a enum value in a sub-VI 7 layers deep in another VI. I would rather get a broken arrow at development time than a peculiar failure intermitantly.

So...
Menu Rings are just fancy numerics, Enums are probably what you want.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(3,490 Views)
I think the issue is that a Strict Typedef should update everything, including the strings inside a ring. And, in fact, it does -- for front panel controls. But ring block diagram constants, for some reason, do not update. This seems a little counter-intuitive, and it's probably not the behavior intended by LabVIEW's authors.
0 Kudos
Message 3 of 4
(3,493 Views)
Ok,

by failing to respond I have left open the possibility that this is a bug.

it is not a bug.

"Menu Rings are just fancy numerics". The text is just not part of the data type. If it was (as in the enum) then the numeric to string translation would come in along with the data when the enum ws made strict.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(3,454 Views)