Hello,
I have read a CSV file and stored it in a Power table. I now want to take one entire column (field name "Value") and send it to an OPC-UA array (100 elements - here is the tag: [edge]GlobalVars/SetupParametersString)
I wanted to put my code in here (and it is below) but it doesn't work and I'm not sure why. I think I need to convert the data to string, but I can't get the ToString command to work either.
I think this is easy, but I am stumped. Can anyone help please?
Thank you!
tbl = event.source.parent.getComponent('Power Table')
tempDS = system.dataset.toPyDataSet(tbl.data)
hdr = ['Value']
newDS =
for row in tempDS:
newDS.append([row[0]])
system.tag.write('[edge]GlobalVars/SetupParametersString',system.dataset.toDataSet(hdr,newDS))
I think that I'm selecting the column correctly, but I am just not writing the data to the OPC Tag correctly. I get the timeout error if the PLC is off:
Error writing to tag '[edge]GlobalVars/SetupParametersString': Bad("Bad_Timeout: The operation timed out.")
And I get this error if the PLC is on:
Error writing to tag '[edge]GlobalVars/SetupParametersString': Bad("Bad_TypeMismatch: The value supplied for the attribute is not of the same type as the attribute's value.")