Adjustable Scaling Capability

I have an application that reads Modbus data and display/stores in a database. I want to upgrade the application to have an engineering screen where the calibration team can enter in calibrated slopes/offsets and then have these corrections applied to my OPC tags, and then everything in the app should use these ‘adjusted’ values.

I did some searching on scaling but didn’t see much. Does anyone have design ideas? I need to have the calibration data available, so I assume I need to create my engineering page and have a button at the bottom with something like ‘write to database’. Then maybe when the app opens, I read all of these values (slope/offsets) into client tags, then do math? So create a whole separate set of tags…

Adjusted Tag = OPC tag * slope + offset

where Adjusted Tag will be a DB or Expression tag. I will then put the Adjusted tags into my transaction groups, into my trends, etc, instead of the OPC tags I have now.

There are scaling fields in the OPC tag setup, but that doesn’t look like it takes variables.

Thanks in advance for your design ideas!

I think you were pretty close in your ideas. I’d create 4 actual tags for each modbus tag:

  1. “TagX_Raw” - OPC Tag tied to modbus
  2. “TagX_Slope” - DB tag
  3. “TagX_Offset” - DB tag
  4. “TagX” DB Tag set to Expression mode: TagX_Raw * TagX_Slope + TagX_Offset

And then use TagX for history, etc. Your calibration screen would simply have numeric entry fields tied directly to TagX_Slope and TagX_Offset.

Thanks Carl - I wanted to make sure I was headed in the right direction.