I have an array of indicators that are created dynamically along with a set of channel properties (array). I would like to map array elements to the captions of the dynamically created indicators. I created a caption text property from one of the indicators and am trying to loop thru and write the proper caption. What I'm seeing is that all the captions get written the same value as it indexes thru the 'for' loop. How do I index into the correct indicator? Thank you!
Solved! Go to Solution.
Based on your Logic the Last Value will be the one which will get reflect. and For array you cannot provide unique Label for each element.
All the Elements in the array will be having same Label.
in an array all elements share the same properties. They only differ by their value.
The caption of the numeric element is a property…
Thanks the text box worked well. One followup on this though. The channel name and units columns are flickering every 100ms (see attached vid). What's the proper way to handle this?
What Gerd says is correct.
But there is also a graphical bug with tables that causes that flickering. You can get rid of the flicker if you take a small transparent decoration and place it so it overlaps the table, even if just barely.
I've dropped the scan time to 200ms and added the transparency decoration. Thank you, those are both good improvements. I'm not sure I want to dive into adding an Event structure to handle value change (assuming that's what you're suggesting)..although I know that's the correct way to do the display.
I have a follow-on question about handling multiple tables. I apologize if I should be starting a new thread, but figure I already had your attention. I added a case statement that splits the displayed channels into two tables. As shown below i'm using the 'last value' of the for loop as an input to the case selector. That obviously doesn't work. I've been fooling around trying to refactor things and thought i would ask for suggestions. Thanks again.
I added a case statement that splits the displayed channels into two tables. As shown below i'm using the 'last value' of the for loop as an input to the case selector. That obviously doesn't work. I've been fooling around trying to refactor things and thought i would ask for suggestions. Thanks again.
Now you need to pause and think things through. As you're sending 'i' to the case selector you're using "How many lines did i recieve, minus one, unless it's zero in case it's still zero". That's not a very secure way of handling the data.
It's better to use Array Size on the incoming array (and even better to switch the notifier to a queue, that's basically all you need to do).
But, i'm assuming your logic is (correct me if i'm wrong):
- If i get 24 channels, update table 1
- elsif i get 0 channels then i'll update the table with an empty array (this should be safe, if unnecessary and is one of the causes of the flicker)
- else update table 2
What i'd do is add a row 1st in the array that indexes which table the data should go to. You just need to add a Split array and let this 1st number control the Case and the other continues on like now.