LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with TypeDef and Ring constants

Hi folks!

I've got a problem with my Ring-TypeDef.
I defined a ring control as a Strict TypeDef, hoping that all constants of this Ring will be updated when I change the definition as it does with Enums.
This does not work. Changes of the TypeDef take effect on the Ring control but not on the constants.

Has anyone an idea how to fix or workaround this?

TIA
Kevin.
Message 1 of 10
(4,112 Views)
Change it to enum...
It would be nice if you take the time to rate this answer
http://www.machinevision.ch
0 Kudos
Message 2 of 10
(4,108 Views)
I was thinking about that, but this not the best solution.
My Ring looks like that:

AOT | 7
RFT | 11
ACK | 13
RET | 17
EOT | 21

This means defining 21 enum values with 5 needed...
0 Kudos
Message 3 of 10
(4,103 Views)
I ran into the same problem, but I found no solution but defining enums and introducing a level of indirection when using the constants, e.g. setting up a translation table.
It would be really nice to have self-updating ring constants. After all this is what we expect strict typedefs should behave.

Desolé 😞

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 10
(4,088 Views)
I don't see the problem you describe...

I just created a ring control, saved it as a strict type def, put two copies of the control on a front panel, edited the type def and both copies of the control changed in exactly the same way (as expected).

Am I missing something?

You seem to indicate that you have a five item ring control which returns non consecutive values up to 21 - I don't see how that is done, could you elaborate?
0 Kudos
Message 5 of 10
(4,075 Views)
You are right. The controls change by changing the TypeDef, but the constants do not!
And I need to use constants.
0 Kudos
Message 6 of 10
(4,073 Views)
Ah, I see, I'm with you now - that is odd - maybe be a bug/error that should be reported?

You didn't explain how you could have five selections with non consecutive numeric values (up to 21) - I'm still curious.
0 Kudos
Message 7 of 10
(4,070 Views)

Mark, as I understand it the idea with ring control/constants is that you can make pairs like the ones described:

yes: 1
no: 99
cancel: -1

but when you create a ring constant say, this feature is turned off, it behaves like a enum. In order to use this non continous numbering you need to uncheck "Sequential values" in propeties/Edit items. This took me some  time to find the first time, and today I again looked a good half hour for it again!

Hope this was what you were asking.

Ola

0 Kudos
Message 8 of 10
(3,859 Views)

Kevin, just how do you define something as a "Strict TypeDef"? Sure this is in the help, but...

Ola

0 Kudos
Message 9 of 10
(3,855 Views)
Right-click on a control, then select Advanced -> Customize. In the opened window, select Strict Type Def instead of Control from the combo box in the toolbar.
Please note that this thread was started 2 years ago, so not all participants may be reachable.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 10 of 10
(3,849 Views)