Creating and Editing User-Defined Constants

Constants are terminals on the block diagram that supply fixed data values to the block diagram. Universal constants are constants with fixed values, such as pi () and infinity (). User-defined constants are constants you define and edit before you run a VI.

Complete the following steps to create a user-defined constant.

  1. Right-click an input terminal of a VI or function and select Create»Constant from the shortcut menu. LabVIEW creates a constant of the default data type of the input terminal and highlights the value.
  2. Type the value you want to assign to the constant and press the <Enter> key. You also can press the up and down arrow keys to assign a value to the constant. LabVIEW resizes the constant to fit its contents. You can resize a string constant the same way you resize a label.
  3. Use the Operating or Labeling tool to click the constant and edit its value. If automatic tool selection is enabled, double-click the constant to switch to the Labeling tool and edit the value.
Note  LabVIEW uses constant folding to optimize the performance of VIs. You can display constant folding on the block diagram by selecting Tools»Options, selecting Block Diagram from the Category list, and placing a checkmark in the Show hash marks for constant folded and loop invariant wires checkbox.

You also can create a constant in the following ways: