Expression taking 17 seconds approx to convert float to string in UDT

Ignition version 7.9.4
I have created a UDT where I receive the date and time in float from a Plc. I pass these values to an expression tag (datatype string type). we are using the following expression for this:

dateformat(fromMillis(tolong(({{[.]IG_CloseDate_R}-25569)*86400000 + tolong({[.]IG_CloseTime_R}*86400000)-(getTimezoneRawOffset()*60*60*1000))), "yyyy-MM-dd HH:mm:ss")

the open /close date and time are in float

This expression takes 17 seconds to resolve.
Is there any way to reduce the time it is taking? 17 seconds is too long.

Did you copy/paste this or incorrectly transcribe it? There are an unbalanced number of curly brackets.

Also, it’s probably not that your expression itself is taking 17 seconds, but that the expression is on a scan class that’s slow for some other reason, like query tag(s). If you move the expression tag to a new scan class, does it still take 17 seconds?

i wrote this code to the website by hand, so there is a chance that i missed a bracket.

so, the expression tag is set to 1 sec, all the other memory tags providing the float values are also set to 1 sec.
when i change a float value , i can count upto 15 before i see the updated string on the expression tag.

Go to your Gateway Webpage >> Status >> Tags >> Click “Details” next to your Realtime Tag Provider >> Scanclasses. You should see a list of your scan classes with various stats. Take a screenshot if you are allowed to and upload here. You’re looking for any scan classes where the “Last Duration” or “Avg Duration” is greater than the rate.

1 Like