Hello,
I’m trying to populate memory tag (Dataset) dynamically, through tag event script (On OPC tags).
I have written code (shown below) on value change event.
table = system.tag.read("[.]Chart Array").value
SetPoint = system.tag.read("[.]SP1").value
MeasureValue = system.tag.read("[.]Measure1").value
if SetPoint > MeasureValue:
system.tag.write("[.]Chart Array", system.dataset.setValue(table, 0, "SP", MeasureValue))
elif MeasureValue > SetPoint:
system.tag.write("[.]Chart Array", system.dataset.setValue(table, 0, "SP", SetPoint))
else:
system.tag.write("[.]Chart Array", system.dataset.setValue(table, 0, "SP", SetPoint))
system.tag.write("[.]Chart Array", system.dataset.setValue(table, 0, "Measure", MeasureValue))
system.tag.write("[.]Chart Array", system.dataset.setValue(table, 0, "Delta", SetPoint))
If I run this code all together, it only updates the “Delta” column from dataset & if I run each command individually (keeping other as comment), it works fine
I did not receive any error to work on.
Thank you