Writing Scaled OPC tag from Memory tag

Hi,

I have a quick question regarding tags, and scaling.

We have a system where we have a SPEED tag and a SPEED_SET tag coming from a PLC.

The SPEED tag, which is read-only and comes in as 2000-5000, which I can scale to 40-100% fine.

The issue comes with the SPEED_SET tag. It is expecting 2000-5000. We have a slider that is in the range 40-100(%).

So my question is, how could I map 40-100 -> 2000-5000 -> Write to SPEED_SET (OPC Tag)?

My current solution is to have the SPEED_SET bind to the slider (40-100), then create a derived tag, which scales the SPEED_SET to 2000-5000, then use an OnValueChanged script to write this to the OPC tag.

Is this the best solution, or am I not seeing something?

Note: I can't bind the derived tag to the slider, as this means the scale goes from 2000-5000, and I cannot do the scaling in the slider itself, as this seems to disable the 'bi-directional' property.

It seems that the derived tag is the only way to have scaling on read and write independently, but this is not enough.

Every OPC tag can have linear scaling applied to it, which is fully bidirectional. Use this on both tags, so the underlying 2000-5000 values are completely hidden. Do be sure to set the tag type float.

image

Like this? I have set it to a memory tag for now.

The slider is a 100% and it is showing a value of 2.0

Looks like you have raw and scaled backward.

Your value source is Memory. The scaling operations only apply to OPC tags.

I can see it changing now, I did not realise that it only applies to OPC values.

Also, when changing the slider now, there is a green box stating, good write pending. Is there anyway I can not show this to the user?