AnsweredAssumed Answered

Expression outputs an array error message when not an array value

Question asked by AlexPoe on Apr 18, 2019
Latest reply on Apr 22, 2019 by sraposo



To start, I have an AF analysis that takes advantage of the array functions that were added recently. We have a handful of PI tags that store alarm values. These tags can have multiple values per timestamp, so we need to combine them into an array in order filter through all of them without missing any values. I've used the filter data function along with the recorded values function to gather all of the alarms that I care about for a particular element into an array (AlarmsArrayElement1, 2, 3, 4 & 5) Then I combine those into one attribute to use with additional filtering (AlarmsArrayElement).


My issue is that System Explorer seems to constantly get confused whether the output is an array or a single value. You'll notice in my snip below that the first set of variables combine nicely and it allows me to map the output to an attribute if I want to. However, for the second set, which is virtually the same, it doesn't give me that option. Instead, I get the error message "This expression outputs and array. Assign an array value to a variable to map it as an output."

I get the error message on additional variables such as StationAlarmInhibit, which, do to if-then-else statements, my output is always an integer of either 0 or 1.


Is there a way to resolve this? From my experience, it seems that sometimes I can create an entirely new analysis, and type up the code again and it will work for some variables, but doesn't work for all. And it's not consistent as to which variables it will let me map.