You are on page 1of 3

Scaling Data in Kepware Products

KEPServerEX and LinkMaster, All Versions


03/02/06

Overview
The purpose of this document is to explain how scaling works in Kepware products.

What is Data Scaling


Scaling is the process of taking raw data from your device and presenting it in a refined or appropriate value for
your application. Kepware products support 2 types of scaling: linear and square root.

KTAN-90043 V1.01

Page 1 of 3

Linear Scaling
Linear scaling is fairly straightforward. A common example would be to take a raw value with a range of 0 1000 as a word and scale it from 0-100.0 as a Float. You generally see this when using devices like Loop or
Thermo Controls that might display a scaled value on their panel but store that value as a whole number.
Typically the scaling is a division by 10 or 100 in linear scale as shown in Figure 1.

Figure 1

Linear Scaling Formula


Scaling is applied to both reads and writes. Shown below is the formula for reading a raw value with linear
scaling in Equation 1 and for writing to that value in Equation 2.

Raw to Scaled (Reading)


Scaled High Scaled Low
+ Scaled Low
(x RAW Low )

Raw
Raw
High
Low

Equation 1

Scaled to Raw (Writing)


RawHigh RawLow
(x Scaled Low )
Scaled High Scaled Low

+ RawLow

Equation 2

Square Root Scaling


Square root scaling is for use when a higher precision is required in the engineering or scaled value. You might
see this if the raw value was a 64 bit Double Precision Float and the client application was not able to handle
numbers that high and a linear scale would not reduce the number to a usable value. Typically you will find that
scaling of this nature is done in the client application.

Page 2 of 3

KTAN-90043

Square Root Scaling Formula


Scaling is applied to both reads and writes. Shown below is the formula for reading a raw value with square root
scaling in Equation 1 and for writing to that value in Equation 2.

Raw to Scaled (Reading)


Scaled High Scaled Low
+ Scaled
(x RAWLow )
Low

Raw

Raw
High
Low

Equation 3

Scaled to Raw (Writing)

RawHigh RawLow
(x Scaled Low )2
2
(Scaled High Scaled Low )

+ Raw
Low

Equation 4

Other Scaling Types


Currently Kepware products do not support other scaling types. More advanced scaling can usually be done in
client applications. You may also be able to create a simple VB application that reads the raw value, applies the
formula, and writes the output to another tag or address in the OPC server. Visit the Kepware web site and
check the Kepware Knowledge Base for code examples.

KTAN-90043 V1.01

Page 3 of 3

You might also like