Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Configuring Output Settings for Numeric Functions

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

The Numeric functions are polymorphic functions. When you wire two or more numeric inputs of different representations to a function, the function usually returns the data in the larger, or wider, representation. The functions coerce the smaller representations to the widest representation before execution and LabVIEW places a coercion dot on the terminal where the conversion takes place.

However, you can configure a Numeric function to return a data type you specify. If you select fixed-point representation as the output and remove the checkmark from the Adapt to source checkbox on the Data Type page, you manually can configure the encoding of the output and how the function handles overflow and/or rounding conditions. After you remove the checkmark from this checkbox, a blue coercion dot appears on the output terminal of the function. In this situation, the width and range of the output type determines whether data loss occurs.

Configuring Output Representation

Complete the following steps to configure the representation for the output of a Numeric function.

  1. Right-click the function and select Properties from the shortcut menu to display the Object Properties dialog box.
  2. On the Output Configuration page, click the data type icon in the Representation section and select the data type you want to use for the output from the shortcut menu. LabVIEW removes the checkmark from the Adapt to source checkbox if the data type you select does not match the data type of the input values.
  3. If you set Representation to FXP (Fixed-point), continue to the following section. Otherwise, click the OK button to close the dialog box and apply the configuration settings.

Configuring Settings for a Fixed-Point Output

Complete the following steps to configure settings for a fixed-point output.

  1. Right-click the Numeric function and select Properties from the shortcut menu to display the Object Properties dialog box.
  2. On the Output Configuration page, click the data type icon in the Representation section and select the FXP (Fixed-point) icon from the shortcut menu. LabVIEW removes the checkmark from the Adapt to source checkbox because the fixed-point data type does not match the data type of the input values.
  3. Select the Rounding mode to specify how the function handles rounding conditions.
  4. Select the Overflow mode to specify how the function handles overflow conditions.
  5. (Optional) Complete the following steps to configure the Encoding of the output.
    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 output.
    3. In the Integer word length field, specify the number of integer bits you want to use to represent the value of the output.
Note  Specifying Encoding has a lower impact on performance than specifying Range. The performance impact of specifying Range is minimal. However, the performance impact can be significant if you run a VI that coerces values to a desired range on a target such as FPGA.
  1. (Optional) Complete the following steps to configure the Range of the output. If you select Wrap as the Overflow mode, you cannot configure the Range of the output because LabVIEW automatically sets the range to fit the encoding.
    1. In the Minimum field, enter the minimum value to which you want the output to conform.
    2. In the Maximum field, enter the maximum value to which you want the output to conform.
    3. In the Delta field, enter the increment between numbers within the Range.
Note  You cannot configure both Encoding and Range because the settings depend on each other. The settings you configure last are the settings that LabVIEW uses for the fixed-point number.
  1. (Optional) Place a checkmark in the Include overflow status checkbox to include an overflow status in the fixed-point output. If one of the inputs of the Numeric function includes an overflow status, the fixed-point output also includes an overflow status, regardless of whether you place a checkmark in this checkbox.
  2. Click the OK button to close the dialog box and apply the configuration settings.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit