Jump to content

Boolean data type

From LabVIEW Wiki
Revision as of 17:37, 17 July 2019 by Logmanoriginal (talk | contribs) (General cleanup)

A Boolean is a primitive data type that can have one of two values: True or False. It is represented by green wires on the block diagram. The Boolean constant can be changed from True Boolean True Constant to False Boolean False Constant by a mouse click.

The Boolean palette provides various functions that can be performed on Boolean values, such as AND, OR, and NOT. Most comparison functions from the Comparison palette return Boolean values.

Controls and Indicators

Boolean palette (front panel)

Boolean controls and indicators are available on the Boolean palette. Some controls can display Boolean text to describe the current state (i.e. ON/OFF).


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 or an emergency stop button). The six types of mechanic actions are:

Behavior Mechanical action Description
Switch when pressed The value of the control change each time it is clicked. This is similar to a light switch.
when released The value of the control only changes once the mouse button is released within the boundary of the control.
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.
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.
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 latch behavior 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