Linear Scale OPC Value DINT to Float

I have an OPC tag that uses linear scaling.

The PLC tag is a DINT, the Ignition OPC tag is a Float. The DINT is in 1/10ths, so 22 = 2.2, 1 = 0.1.

My linear scaling is set up like so.

rawLow = 0.0
rawHigh = 1.0
scaledLow = 0.0
scaledHigh = 0.1

For the moment I'm using @pturmel 's Eth/IP Host device as a tag host. It connects to the OPC tag, but if I change the value of the tag in the Ignition tag browser to 4.5 it rounds up to 5. And if I enter 4.4 it rounds down to 4. Why is it behaving as an integer?

Am I missing something, or is this just odd behavior because I'm trying to write to a tag that would normally only be read?

Is your format string set up to only display integers? Might try setting it to something like #,##0.0

I'm looking at the tag value in the tag browser. Format string is still default "#,##0.##"

When you click the value to change it, does it show the decimal after clicking on it, or is it rounding the value? Might try using the script console to read the value and print it just to see what value it's seeing. Or look at tag diagnostics to see what value it shows in there.

1 Like

It shows the value with a decimal, but it has rounded.

image
image
image
image

Of course now it works... wth

2 Likes

Isn't that the way it works. I recently had an issue and was able to replicate it reliably. Contacted support, opened a ticket, did a bunch of troubleshooting and they couldn't replicate it. 8.1.40 was released, so I decided to upgrade just to see if it had the issue, and it seems to be fixed, but wasn't a part of any fixes, so I wonder if I just had some corruption or something and a fresh install fixed it.