Jump to content

Boolean data type

From LabVIEW Wiki
Revision as of 14:11, 19 July 2019 by Logmanoriginal (talk | contribs) (Change section names for clarity)

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 is represented by a dynamic element that can be changed from True Boolean True Constant to False Boolean False Constant with a left mouse click.

Boolean palette

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.

Boolean 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 of Boolean controls

Boolean controls have mechanical actions, which control how activation with the mouse affects the value of the control. A mechanical action allows the control to mimic certain physical actuators (e.g. a light switch or an emergency stop button).

Mechanical actions

The six types of mechanical actions are:

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