Can you define a tag DataType by a paramter in a UDT?

I have an UDT.

  • Alarm
    • CurrentValue
    • ActivateValue
    • isActive

I need that same UDT with type Boolean, Integer and Double for CurrentValue and ActivateValue.

Could I usa a parameter to define that datatype?

Thanks in advance!

Yes, you can. Just need to reference the parameter in a binding on the DataType for the tags.

1 Like

image

Like this?

Cause it doesn't work when I write Double

That's in the UDT definition. You need to create an instance of the UDT for the expression to be processed. Putting Double there is like setting the default value.

I created an UDT definition. I added a parameter, then I linked the datatype tag with the paramter ( {type} ) as shown in the previouse image.

Then, I created a new datatype instance of that UDT and wrote Double in the parameter.

The tag type for some reason is not Double, but Int.

Not sure what I'm doing wrong or if it's even possible.

See this for the correct string names.

1 Like

Well, I would have thought that worked, since they allow you to configure a binding on it. I would say this is a bug.

I tested with both the correct String value, which would be Float8 and the Integer value 5, but neither actually updated the Data Type of the tag in the Instance, which in my case remained a String.

That being said. You can just override the data type on the tags, which isn't as clean but will work.

1 Like