Alternatively show the actual dataset values in the log.
I am manually doing it by opening the designer and modifying the existing dataset values from tag browser.
I'm on v 8.1.48

def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
if not initialChange and currentValue.value != previousValue.value:
logger = system.util.getLogger('TagChangeExec_Test')
logger.info('Exec')
logger.info('initialChange : '+ str(initialChange) + ' currentValue.value : ' + str(currentValue.value))
data = system.dataset.toPyDataSet(currentValue.value)
for row in data:
logger.info(str(list(row)))
JSON tag
{
"valueSource": "memory",
"eventScripts": [
{
"eventid": "valueChanged",
"script": "\t\n\tif not initialChange and currentValue.value !\u003d previousValue.value:\n\t\tlogger \u003d system.util.getLogger(\u0027TagChangeExec_Test\u0027)\n\t\tlogger.info(\u0027Exec\u0027)\n\t\tlogger.info(\u0027initialChange : \u0027+ str(initialChange) + \u0027 currentValue.value : \u0027 + str(currentValue.value))\n\t\tdata \u003d system.dataset.toPyDataSet(currentValue.value)\n\t\tfor row in data:\n\t\t\tlogger.info(str(list(row)))"
}
],
"dataType": "DataSet",
"name": "Tag0",
"value": "{\"columns\":[{\"name\":\"Col0\",\"type\":\"java.lang.Boolean\"},{\"name\":\"Col1\",\"type\":\"java.lang.String\"}],\"rows\":[[true,\"0\"]]}",
"tagType": "AtomicTag"
}
This is may be your issue. Designer may be writing to the tag twice...although I am unable to duplicate your issue in the 8.3 designer. 8.1 is a little different in regards to datasets, so my test is not a 1:1 comparison to your issue.
You should write some actual code on a test button. Do not use the tag editor for testing.
This code on my test button in 8.3:
def runAction(self, event):
import traceback
logger = system.util.getLogger("dataset value change test")
try:
inDataset = system.tag.readBlocking(["[default]Tag0"], 1000)[0].value
oldValue = inDataset.getValueAt(0,0)
newValue = not oldValue
newDataset = system.dataset.setValue(inDataset, 0, 0, newValue)
system.tag.writeBlocking(["[default]Tag0"], newDataset, 1000)
except:
#Log any show stopping errors
message = traceback.format_exc()
system.perspective.print(message)
logger.error(message)
Yes, I implemented the logic at the button level, and now it executes only once.
However, the double execution behavior still surprises me, because it only happens when working with dataset tags. Other tag types do not trigger the script twice when edited directly from the Designer’s Tag Browser.
So I loaded up 8.1.48 and re-did the identical test I did in 8.3.2 and sure enough it fires twice now, same as OP is seeing. So it does seem like it's a bug related to that version that was fixed between then and 8.3.
However it specifically only happens when editing from the tag -editor-, if you go and drill down through the tag browser and change a value there it does not happen twice.
Edit: Looks like the tag editor is just doing some stupid stuff. I did a test where all I did was add a space to a comment in the tag change and it executes 3 times. So, yeah.

