Scripting - system.tag.configure - Create UDT

I’m on 8.1.1

I try to dynamically configure tags, I want to create a UDT…

Is there a way to do something like this ?

        if tagData == "Integer":
			tagDataType = "Int4"
		elif tagData == "Long":
			tagDataType = "Int8"
		elif tagData == "Float":
			tagDataType = "Float4"
		elif tagData == "Double":
			tagDataType = "Float8"
		else:
			tagDataType = tagData
			
		tag = {
			"name": tagName,
			"opcItemPath" : {OPCpath}.{TagName},#opc_path,
			"opcServer": {OPCserver},#opc_server,
			"dataType": tagDataType,
			"valueSource": "opc",
			"sampleMode" : "tagGroup",
			"tagGroup" : "default"
			}
	collisionPolicy = "o"
	system.tag.configure(tagPath, [tag], collisionPolicy)

I’m OK… I finally be able

tag = {
				"name": tagName,
				"tagGroup": tagGroup,
				"tagType": "AtomicTag",
				"valueSource": "opc",
				"dataType": tagDataType,
				"opcItemPath":
					{
					"bindType":"parameter",
					"binding":"{OPCpath}.{TagName}"
					},
				"opcServer":
					{
					"bindType":"parameter",
					"binding":"{OPCserver}"
					},
				"engUnit": "m\xb2" 
			}
			collisionPolicy = "o"
			system.tag.configure(tagPath, [tag], collisionPolicy)
1 Like