Scaling Shared Variables
- Updated2025-08-15
- 3 minute(s) read
You can scale the value of a shared variable with the following data type:
- Numeric
- Boolean
- U32 Bit Field
Note You can use scaling only for
network-published
shared variables, I/O variables, or I/O aliases. When the shared variable you want to scale is a network-published shared variable, it must have a data source. Configure a network-published shared variable to have a data source by placing a checkmark in the
Enable Aliasing
checkbox on the
Variable
page of the
Shared Variable Properties
dialog box.
Scaling Numeric Shared Variables
Complete the following steps to scale numeric shared variables.
- Right-click a shared variable in the Project Explorer window and select Properties from the shortcut menu to display the Shared Variable Properties dialog box.
- Select Scaling to display the Scaling page.
- Place a checkmark in the Enable Scaling checkbox.
- Select one of the following scaling options from the
Scale Type
pull-down menu.
- Linear —Enables a linear mx + b conversion between raw and engineering ranges.
- Square Root —Enables a square root conversion between the raw Raw Zero Scale and Raw Full Scale and engineering Engineering Zero Scale and Engineering Full Scale ranges, which is b + m * sqrtraw – o where b = Engineering Zero Scale, m = Engineering Full Scale – Engineering Zero Scale/sqrtRaw Full Scale – Raw Zero Scale, and o = Raw Zero Scale.
- (Optional) In the Engineering Unit text box, specify the unit of data measurement, such as degrees Celsius, pounds, grams, and so on.
- Specify the raw and engineering ranges in the Raw Full Scale, Raw Zero Scale, Engineering Full Scale, and Engineering Zero Scale numeric controls.
- (Optional) Place a checkmark in the Coerce to Range checkbox to coerce the data to the specified range.
- Click the OK button to close the Shared Variable Properties dialog box.
Scaling Boolean Shared Variables
Shared variables with a data type of Boolean can have inverted scaling. Complete the following steps to scale Boolean shared variables.
- Right-click a shared variable in the Project Explorer window and select Properties from the shortcut menu to display the Shared Variable Properties dialog box.
- Select Scaling to display the Scaling page.
- Place a checkmark in the Enable Scaling checkbox.
- Place a checkmark in the Invert checkbox for the Shared Variable Engine (SVE) to invert the Boolean value when the SVE communicates with the device server.
- Click the OK button to close the Shared Variable Properties dialog box.
Scaling U32 Bit Field Shared Variables
Shared variables with a data type of U32 Bit Field can have invert-mask and/or select-mask scaling. Complete the following steps to scale bit array shared variables.
- Right-click a shared variable in the Project Explorer window and select Properties from the shortcut menu to display the Shared Variable Properties dialog box.
- Select Scaling from the list of this dialog box to display the Scaling page.
- Place a checkmark in the Enable Scaling checkbox.
- In the Scaling Invert Mask text box, set the bits you need to scale. LabVIEW masks the bits you do not set and reports these masked bits in an array as zeros.
- In the Scaling Select Mask text box, set which bits are inverted between the device server and the Shared Variable Engine. You can invert only the bits specified in this text box.
- Click the OK button to close the Shared Variable Properties dialog box.
(DSC Module) To scale shared variables programmatically, use the SharedVariableIO properties.