OPC Item Path takes decimal point on its own

Hi.. I have created one UDT and an OPC tag in it. I have used tag parameters for OPC Item Path
image

where {Rack} and {IsSW} are the UDT parameters.
But when I create an instance, it is adding decimal point on its own ( .0 ) to the OPC Item value.

image

HR62550.0
That decimal point is not needed in my case.
Can you please suggest to remove that '.0' part? i.e., only HR62550

Note - {Rack} is String and {IsSW} is Integer.

Hmm. Seems like a bug. You should report it.

I just tested this on a test UDT, and it works as expected?
Is that space after 700 there on purpose?

[{Rack}]HR{62550 + IsSW*700}
With IsSW set to 2 I end up with

[WM2]HR63950

1 Like

Did a bit of testing. When IsSW is set to integer with a value of 1, I get [MMS_A_01_R1]HR63250 no matter if the trailing space is there or not. If I change IsSW to a string, then I get the same value as you with the trailing decimal. Verify both in the template and in your instance that the type of IsSW is integer and not a string.

Edit: What stood out is that even with it being a 1, it should add 700 to 62250, but it wasn't, it was concatenating a string of "1" multiplied by 700 and probably adding that value to 62250 and treated it as a floating point as 62250.0

If you use system.tag.configure() to instantiate UDTs, and provide parameters, those parameters are all forced to be strings, despite the UDT declaring them otherwise. (At least, in all the Ignition versions I've tested this with.) :frowning_face:

You must set UDT instance parameters after creation using system.tag.writeBlocking() to retain the parameter data types.

2 Likes

I did verify again, IsSW is an Integer only. But yeah.. that unwanted decimal poiont is still there even though I remove the spaces form the OPC item path.

This is what I checked
image

And still the decimal point
image

Read the parameter on the instance and see if it is still an integer.

1 Like

Good point, I know when I upgraded last from v7 to 8, it converted a lot of my, from memory, string params to integer params in the instances. That was early day conversions though