09-15-2021 09:21 AM
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?
This is how it should look like...
Thank you
Bow
Solved! Go to Solution.
09-15-2021 09:29 AM
It does not make much sense to display such a list. Why you would not to remove duplicated values?
09-15-2021 10:31 AM - edited 09-15-2021 10:36 AM
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.)
09-16-2021 12:30 AM
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
09-16-2021 07:08 AM
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,