Configuring Fixed-Point Numbers

You can configure the encoding for a fixed-point number in a numeric control, constant, or indicator.

After you configure a fixed-point control, constant, or indicator, that object cannot display a number that does not conform to the settings you specify. If the object you configure is an indicator, LabVIEW coerces any input value to the indicator to conform to the fixed-point configuration settings of the indicator.

Configuring Controls

Complete the following steps to configure a fixed-point number in a numeric control.

  1. Right-click the control and select Properties from the shortcut menu to display the Numeric Properties dialog box.
  2. On the Data Type page, click the data type icon in the Representation section and select FXP (Fixed-point) from the shortcut menu. The Fixed-Point Configuration section displays default values for the Encoding and Range options.
  3. (Optional) Complete the following steps to configure the Encoding of the fixed-point number.
    1. Select Signed or Unsigned to specify whether you want to represent a signed or unsigned number.
    2. In the Word length field, specify the total number of bits you want to use to represent the value of the fixed-point number.
    3. In the Integer word length field, specify the number of integer bits you want to use to represent the value of the fixed-point number.
Note  LabVIEW calculates the Range of the fixed-point number according to the values you specify for the Encoding of the fixed-point number.
  1. (Optional) Place a checkmark in the Include overflow status checkbox to include an overflow status in the fixed-point number.
  2. Click the OK button to close the dialog box and apply the configuration settings.

Configuring Constants

Complete the following steps to configure a fixed-point number in a numeric constant.

  1. Right-click the constant and select Properties from the shortcut menu to display the Numeric Constant Properties dialog box.
  2. On the Data Type page, remove the checkmark from the Adapt to entered data checkbox.
Note  When you select Adapt to entered data, LabVIEW displays any value you enter with the shortest possible word length and integer word length. You must remove the checkmark from this checkbox if you want LabVIEW to retain any changes you make to the Fixed-Point Configuration settings.
  1. Click the data type icon in the Representation section and select FXP (Fixed-point) from the shortcut menu. The Fixed-Point Configuration section displays default values for the Range and Encoding options.
  2. (Optional) Complete the following steps to configure the Encoding of the fixed-point number.
    1. Select Signed or Unsigned to specify whether you want to represent a signed or unsigned number.
    2. In the Word length field, specify the total number of bits you want to use to represent the value of the fixed-point number.
    3. In the Integer word length field, specify the number of integer bits you want to use to represent the value of the fixed-point number.
Note  LabVIEW calculates the Range of the fixed-point number according to the values you specify for the Encoding of the fixed-point number.
  1. (Optional) Place a checkmark in the Include overflow status checkbox to include an overflow status in the fixed-point number.
  2. Click the OK button to close the dialog box and apply the configuration settings.

Configuring Indicators

Complete the following steps to configure a fixed-point number in a numeric indicator.

  1. Right-click the indicator and select Properties from the shortcut menu to display the Numeric Properties dialog box.
  2. On the Data Type page, click the data type icon in the Representation section and select FXP (Fixed-point) from the shortcut menu. The Fixed-Point Configuration section displays default values for the Range and Encoding options.
  3. (Optional) Place a checkmark in the Adapt to source checkbox if you want the value to inherit the fixed-point configuration settings of an input fixed-point value. If you select this option, skip to step 7.
  4. (Optional) Complete the following steps to configure the Encoding of the fixed-point number.
    1. Select Signed or Unsigned to specify whether you want to represent a signed or unsigned number.
    2. In the Word length field, specify the total number of bits you want to use to represent the value of the fixed-point number.
    3. In the Integer word length field, specify the number of integer bits you want to use to represent the value of the fixed-point number.
Note  LabVIEW calculates the Range of the fixed-point number according to the values you specify for the Encoding of the fixed-point number.
  1. (Optional) Place a checkmark in the Include overflow status checkbox to include an overflow status in the fixed-point number.
  2. Click the OK button to close the dialog box and apply the configuration settings.