LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
d.w.b

Text Ring Auto-Update from Type Def. should be disabled

Status: New

Strict Type Def Text Ring does not auto-update constants. Since NI support says this is expected behavior (http://digital.ni.com/public.nsf/allkb/46CC27C828DB4205862570920062C125) then the right-click pop-up menu item that is checked be default indicating that it will be updated automatically should be hidden, disabled (greyed out), or uncheckable so developers are not mislead to believe they will be updated. This has caused defects and when found requires much work to search for and replace all the constants, if a value is inserted for example. They did not want to create a CAR for this.

Steps to Reproduce:  

Given x.ctl on disk, create new VI, drag x.ctl onto block diagram, right click, Open Type Def. It opens x.ctl in its own window. Right click the control, Edit Items..., change the name, position, or add item. File Save, File Apply Changes, Close. Look at the block diagram constant. It does not contain the change just made. Right click, Auto-Update from Type Def. is checked and Open Type Def. opens the .ctl where the new values can be seen. Replace with and browse to the x.ctl does not update the constant. However, Change to Control or Indicator does update it and then after change back to constant it will reflect the right content.

5 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

It's worse. If you have a Text Ring control that supposedly auto-updates from a typedef and you edit that Typedef, apply changes or save it, the control will NOT be updated. Why? Because the strings are an "accessory" to the type as explained in the KB entry you linked to.

Change the representation of the Typedef (say U16 -> I32), Apply Change, and this will immediately be reflected in Controls, Indicators and constants. Ergo your request can't be fulfilled.

crossrulz
Knight of NI

Possibly a stupid question, buy why not just use an Enum?  The only reason I can think of is if you needed a Sparse Enum.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
d.w.b
Member

@ crossrulz : Agreed, use enums instead of rings when possible. But perhaps Text Ring is used instead because it is first in the palette and/or the developer just doesn't know the repercussions. After all, it auto-increments item values by 1 just like enums and "enum" is a familiar term only to some text-based language developers.

d.w.b
Member

@ X. : Agreed, Auto-Update from Type Def. should not be disabled because it serves a purpose, e.g. updating the data type / representation. Thanks for succinctly conveying that.

elset191
Active Participant

@crossrulz wrote:

Possibly a stupid question, buy why not just use an Enum?  The only reason I can think of is if you needed a Sparse Enum.


This is how I first discovered this trap.  Made a text ring with error codes for an instrument I was using, which happened to not be consecutive numbers. 

--
Tim Elsey
Certified LabVIEW Architect