I have the following code on a tag value change script:
ds = currentValue.value
delRows = []
lim = system.tag.read("[.]data_limit").value #set to 100
if ds.getRowCount() > lim:
for i in range(0, ds.getRowCount() - lim):
delRows.append(i)
currentValue.value = system.dataset.deleteRows(ds, delRows)
My dataset is going well above 100 a few rows at a time. It seems like the tag value change script is not firing for whatever reason. Is it possible that adding a row to a dataset is not triggering the change script?
You need to create a new dataset and write it back to the tag via system.tag.writeBlocking. You can’t just modify the dataset value you receive in the event or assign a new value back to the event object.
No, it's just a copy of the tag's qualified value.
In some older versions modifications to "container" values like datasets or documents would mutate the actual value in the tag, but this was unintentional and fixed at some point.
Well, it never would have worked the way you want, because part of the brokenness of that was that it didn't fire off event changes because nothing in the tag system knew about the value change.