LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selection Ring/Enum with identical values?

Solved!
Go to solution

Hi,

 

I can't come up with a solution for my problem. I want to populate a Ring with different values which come from a ini file with different timeouts and save it as a tdef.

 

The user should select a timeout from the FP via the string name and the corresponding value is handled by the code.

Also I want to use the Ring myself to select the specific constant for delays in the code. 

 

In my case, it is possible that some values can be the same, which is not possible with Ring or Enum data types. 

 

Do you have an idea for a solution?

 

LabviewBow_1-1631715101088.png

 

LabviewBow_0-1631715052898.png

This is how it should look like...

 

Thank you

Bow

 

0 Kudos
Message 1 of 5
(1,332 Views)

It does not make much sense to display such a list. Why you would not to remove duplicated values?

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 5
(1,326 Views)
Solution
Accepted by topic author LabviewBow

Set the ring to "sequential values", the use that to index into an array of timeouts. (Of course the array would not be a diagram constant, but read from file and e.g. kept in a shift register, action engine, or similar.)

 

altenbach_0-1631720129026.png

 

0 Kudos
Message 3 of 5
(1,302 Views)

yeah I thought about workarounds like this. I think I will go with a map.

At least I am sure that there is no obvious solution that I missed 😄

 

Thanks

0 Kudos
Message 4 of 5
(1,262 Views)

Since your values are all integers, you could change the representation to Double, then use the fractional part to distinguish the items.  In the code, round down before using the value.  E.g: Timeout A could have a value of 10.1. Timeout B could be 10.2, etc,

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 5
(1,234 Views)