Jump to content

Boolean data type

From LabVIEW Wiki
Revision as of 16:45, 17 July 2019 by Logmanoriginal (talk | contribs) (Add history of Boolean constants)

A Boolean is a primitive data type that can have one of two values: TRUE or FALSE. Various operations from the Boolean palette can be performed on these, such as AND, OR, and NOT. Most comparison functions return Boolean data.

In addition to label and caption text, boolean controls and indicators can display "boolean text" that can depend on the state of the control. This allows a control or indicator to show a textual representation of its state (e.g. ON/OFF).

On the block diagram, boolean data is represented by green wires.

Mechanical action

Boolean controls have mechanical actions, which control how activation with the mouse affects the value of the control. Mechanical action allows a control to mimic certain physical actuators (e.g. a light switch, emergency stop button). The six types of mechanic actions are:

  • Switch when pressed. The value of the control change each time it is clicked. This is similar to a light switch.
  • Switch when released. The value of the control only changes once the mouse button is released within the boundary of the control.
  • Switch until released. The value of the control changes only so long as the mouse button is held down. When the mouse button is released, the control returns to its default value.
  • Latch when pressed. The value of the control is updated when the mouse button is depressed. Once the VI reads the value of the control, it returns to its default value.
  • Latch when released. The value of the control is updated when the mouse button is released within the boundary of the control. Once the VI reads the value of the control, it returns to its default value.
  • Latch until released. The value of the control is updated while the mouse button is held down, or until the VI reads the value, whichever comes first.

The three "latch" behaviors can not be used if the control has a local variable on the block diagram.

History

In LabVIEW 2010 the representation of Boolean constants on the block diagram changed so that only the currently selected value is visible.

Icon LabVIEW Versions
Boolean True
Boolean True Constant Before LabVIEW 2010
Boolean True Constant Since LabVIEW 2010
Boolean False
Boolean False Constant Before LabVIEW 2010
Boolean False Constant Since LabVIEW 2010

This change was suggested by user altenbach on the LabVIEW Idea Exchange on 03.07.2009 and later confirmed to be included in the beta version of LabVIEW 2010 by user Wonger on 23.02.2010.

See Also

External links