Get Last 2 digits of UDT Instance name, in a parameter?

See screenshot

How can I get the 00 or 01 etc from the Step Tag name and set it as the value of the parameter Step_Element
I also need to format it to remove the 0 paddings. so 1 digit numbers are only one digit.

I’m not sure you can. Typically you would do this the other way around. You would setup your parameter, then use the parameter to create your UDT instance name.

Depending on your setup you might be able to make an expression tag and use the {InstanceName} parameter and

That doesn’t give it to you as a parameter, but it would let you access the value if you need it for something else.

You could create a memory expression tag in the UDT and do something like


ok, I have created a Memory Tag called “Index_OnPLC” and I am getting the right value in it. but how do I get the value into a parameter?

I have tried {[.]Index_OnPLC} and {Index_OnPLC}

ORRRR a different approach How can I automatically add 200 copies of a UDT type in to parent UDT definition, and just increment the parameter value without having do it manually 200 times?

You could write a tag change script on one of the tags that then writes back to the UDT instance and sets the parameter.

For bulk operations I have scripted tables that will create the tags.

Your best bet for a quick bulk creation is to create a few instances, select them, right click, export to XML.
Edit the XML and duplicate the lines for the tags and then just change the values.
Go back to the tag browser, right click, import, and import the modified XML.