キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Selection Ring/Enum with identical values?

解決済み
解決策を見る

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 件の賞賛
メッセージ1/5
1,498件の閲覧回数

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 件の賞賛
メッセージ2/5
1,492件の閲覧回数
解決策
トピック作成者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 件の賞賛
メッセージ3/5
1,468件の閲覧回数

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 件の賞賛
メッセージ4/5
1,428件の閲覧回数

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 件の賞賛
メッセージ5/5
1,400件の閲覧回数