LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

typedefined constants do not adapt to changes in type def?

Hi,

have not recognised this before and could not find it  searching ni.com:

I have a type definition for a  ring control as status indicator for some test steps. The items are defined as non-continuos and their numeric value reflects the status. Like 'OK' is 0x00ff00 and 'Fail' is 0xff0000.
I created some constants from this type definition in order to have defined values in given situations.
Later I had to change the type definition, added some items and changed the numeric value of others.
BUT THE CONSTANTS DID NOT ADAPT!
They still claimed to be connected with the type def. I even tried a strict type def and did not allow undefined values. No improvement!

Is this a known issue? Or even intended (as a constant shall stay constant)? But in the latter case than constants cannot be connected with type definitions!

Message 1 of 4
(2,923 Views)
Hi Lul, it's right what you guess, only enum constants are self-adapting. On the other hand, enum values are sequential.
AFAIK, this is the choice. To enum or not to enum?

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 4
(2,916 Views)

This gets back to the basic distinction between a ring and an enum. The value of a ring is a number, the string is just a label. By contrast, an enum's value is the text representation you see in the control. This is why you can change the strings of a ring at runtime--but can't change an enum. And its also why the ring typedef constants don't update: changing the labels doesn't effect they type definition of the object so logically there is nothing to update.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
0 Kudos
Message 3 of 4
(2,906 Views)
Thanx ,

Steven Mercer (NI) wrote on Info-LabVIEW:
But to elaborate a bit, we do not update "display attributes" for anything on the block diagram. The "strict" vs "non-strict" typedef does not change the behavior on the block diagram at all. And since ring text is purely for display, then it doesn't get updated.

Anyhow, having had this type def it was not so hard to 'find all instances' and to manually replace all of them with the updated type def.
BTW, This would be an interesting script to create Smiley Wink

Greetings from Germany!<br>-- <br>Uwe


Message 4 of 4
(2,900 Views)