Boolean

From LabVIEW Wiki
Jump to: navigation, search

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.

See Also