Access UDT parameter in script

Just as Kevin’s suggestion in jsonSet workaround in script

I just tested that it’s possible to write back the struct value through script (Ignition version 8.0.4 Nightly)

With below script, the UDT member ‘param1’ of ‘OPC_tag’ can be updated and writen back to OPCUA server.

value1 = system.tag.read(‘OPC_tag’).value
value1 = system.util.jsonDecode(str(value1))
value1[‘param1’] = ‘updated_param1_value’
value2 = system.util.jsonEncode(value1)
system.tag.write(‘OPC_tag’, value2)