Good afternoon,
We have a program on Ignition that reads bits from a plc and tries to match them up with faults on a global scripting project script.
The tag Collector concatenates 10 OutputStrings0-9 into a large string like:
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
This string is then sent off via a valueChanged() script:
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
if missedEvents == True:
meDS = system.tag.read("[.]Missed Events").value
data = (currentValue.value,system.date.now())
meDS = system.dataset.addRow(meDS, data)
system.tag.write("[.]Missed Events", meDS)
Corporate_Monitor.extractor(tag, tagPath, currentValue.value, previousValue.value, faultsType=tag['parameters']['faultType'])
The problem is that sometimes, the collector freezes and stops updating itself based off of the values in the OutputStrings changing.
This problem can be easily manually fixed by just right clicking the collector tag and hitting 'Refresh'. But until we do this, the tag stays frozen.
We were thinking of ways to try to resolve this, like enabling/disabling the collector every 5 minutes, or binding it to some FlipFlop like
//Always evaluates to same path, but forces refresh of value scans
if({[.]ChangeFlip},
concat({[.]OutputString0},{[.]OutputString1},{[.]OutputString2},{[.]OutputString3},{[.]OutputString4},{[.]OutputString5},{[.]OutputString6},{[.]OutputString7},{[.]OutputString8},{[.]OutputString9}),
concat({[.]OutputString0},{[.]OutputString1},{[.]OutputString2},{[.]OutputString3},{[.]OutputString4},{[.]OutputString5},{[.]OutputString6},{[.]OutputString7},{[.]OutputString8},{[.]OutputString9}))
But both of these options seemed somewhat expensive for the number of tags we would be using it on.
Is there a better way to do this?
Why is our expression tag freezing?
Thank you,
Alex