Efficient population of a List with fixed data


#1

1) Give a description of the problem
Looking for a better(?) way to fill an array (list)

2) What is the expected behavior?
The piston works as is but instead of filling the array (list) with the fixed data, I am calculating it during each piston run.

3) What is happening/not happening?
Want more efficiency and how-to advice.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
Not needed for this discussion.

I’m learning about using lists (I keep wanting to call them arrays) in WebCoRE by enhancing my Thermostat SetPoint Piston. In simplest terms, I want to put number’s names into a list (i.e., ONE instead of ‘1’, etc)
so I can use them later in the piston for text-based logging and notifications. The piston works the way it is, BUT it calculates/sets/fills the list with the same data every time it runs. I want ot fill the list with fixed data but need help. TIA.


Need your feedback on a new key-value piston input type in webCoRE
#2

Bump, please.

It seems to me that I should be at least be able to fill the list with a single, comma delimited line - preferably in the ‘define’ section, but at least in the execution section of the piston. I just can’t see a way to accomplish it.


#3

You can use a string ZERO,ONE,TWO,THREE,FOUR,FIVE rather than string list and access it with the arrayItem function which operates on comma-separated strings. arrayItem(TStatSPCounter, NumWords)


#4

Excellent! Thank you for the push in the right direction. I’ll give that a try.!


#5

Thank you again for your great advice! It works perfectly. Here’s what we have now: