I have an OPC integer tag containing a mode number but I need to have several boolean expression tags to indicate which mode is currently active. For example, if Mode = 5, the Mode_Bin5Selected bit should be ON, and the other status bits should be OFF. This is working fine.
Some of the OPC mode variables are actually integer arrays. I created Boolean Array Expression Tags. However, I'm not sure how to write the expression so it compares each OPC array element with the mode number, and writes the result to the corresponding element in the expression tag array.
I was hoping I could use a syntax something like this in the tag's expression, where x is the element number in the source and destination arrays:
{[.]RAWMATERIALSOURCES[x]} = 5
Or, in a script:
for nElement = 0 to ArrayLength({RAWMATERIALSOURCES})
me[nElement] = ({[.]RAWMATERIALSOURCES[nElement]} = 5)
I'm just getting started using Ignition, so I'm not sure what the syntax would be for an actual script.
I found a similar question in the forum, but it was from 8 years ago, so I'm not sure it still applies, and I didn't see a clear answer.
Thanks!
Eric