Every tag in your project can be scaled or even have a mathematical equation applied to it. This is extremely useful when you need to get an engineering value from raw values. To enable scaling on a given tag, please select the corresponding row and click on the Eng. Unit cell. A new dialog is shown:
There are three options you can set:
1. Not Set – no scaling is applied
2. Scale – you can scale and offset the tag value
3. Equation – you can apply a mathematical equation for more complex situations
Scaling tags
To scale a tag, please fill in the equation in the dialog. You can multiply the tag by a constant, divide it, and set the offset. The equation is as follows:
Value = multiplicator * tag / divider + offset
Applying equation
To apply the equation to your tag, select the Equation tag. Here you can use multiple mathematical operations in your formula. The tag value should be inserted into the equation as the word tag. The following dialog shows how to compute the sinus value of the tag multiplied by 10.
- TIP: To test if the formula is valid, use the “Test” button.
Simple example of scaling a tag
A very common situation is a representation of floating values by integers in PLCs (especially on Modbus devices). In our example, we will scale the value read from a Modbus device to achieve a floating-point value.
1. Select your tag in the tag database and click on the Eng. Units cell
2. Set divider in the dialog to 10
3. Now your value will be automatically scaled by 10. So if you will read, for example, the value 235, it will be represented as 23.5