Dynamic Scaling for Tags?

A SCADA in development is designed to pull data off of an OIT that provides dynamic decimal point placement and dynamic scaling for a limited number of tags. We've been able to achieve the dynamic decimal points using expressions, but the scaling seems more complicated. The only place I can see to control tag scaling is on the tag itself, where no bindings exist. Is there a work around, or some information I may be missing? I am not seeing anything in the help manual or forum, so any ideas would be appreciated!

If you're already using an expression binding you should be able to do your scaling manually in there. Hopefully you've made those tags as part of a UDT. Ideally you would have some parameters to the UDT that would determine the scaling.

Technically, this is scaling. You're just always using multiples of 10.

An expression such as this would do the trick. (Linear Scaling):

{originalValue} * ({scaledMax} - {scaledMin}) / ({inputMax} - {inputMin}) + {scaledMin} - ({inputMin} * ({scaledMax} - {scaledMin}) / ({inputMax} - {inputMin}))

Alternatively, you can use system.tag.writeBlocking() to write to the scaling parameters of a tag:

#assuming a Linear Scaled Mode
tagPaths = ["path/to/your/tag.scaledLow","path/to/your/tag.scaledHigh"]
system.tag.writeBlocking(tagPatsh,[0,100])
1 Like