Boolean Controls and Indicators

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2015 Help
LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help

Use Boolean controls and indicators located on the Boolean subpalettes to enter and display Boolean (TRUE/FALSE) values with objects such as buttons, switches, and LED lights. The following list describes the common use cases of Boolean controls and indicators available on the Modern, NXG Style, Silver, System, or Classic subpalettes:

Note  The availability of Boolean controls and indicators may vary depending on the subpalette style you choose. Refer to the Modern, NXG Style, Silver, System, or Classic subpalette for Boolean control and indicator availability.
  • Buttons—Use as a control to select a command by depressing the button.
  • Rockers, Toggles, and Switches—Use as a control to select a command by rocking, toggling, or switching the object from one position to the other.
  • LEDs—Use as an indicator to display that a condition is met. LabVIEW turns the light ON or OFF depending on whether the condition is met.
  • Radio Buttons—Use as a control to select a command from a list of choices.
  • Checkboxes—(System palette only) Use as a control to select a TRUE or FALSE state, such as when only one option is possible.
  • Mixed Checkboxes—(System palette only) Use as a control to select a TRUE, FALSE, or MIXED state, such as when simultaneously setting a property of multiple objects where some are TRUE and FALSE.

Related Information

Creating and Operating Boolean Controls and Indicators

Creating a Radio Buttons Control

Configuring a Mixed Checkbox

Mechanical Actions of Boolean Controls

Use the configurable mechanical action of a Boolean control to create front panels that resemble the behavior of physical instruments such as oscilloscopes and multimeters. Switch and latch actions are similar in that they both change the value of the Boolean control. The actions differ in how the value of the control reverts to the previous value.

  • Switch action—Use a switch action when you want only the user to revert the value of the control back to the previous value.
  • Latch action—Use a latch action when you want the VI reading the control to revert the value of the control back to the previous value. The user can also return the value of the control to the previous value, but only if the user does so before the VI reads the control.
Note  Latch actions cannot be used with local variables, and latch actions used with event structures typically have their terminals placed inside the Value Change event frame.

Right-click a Boolean control and select the behavior from the options in the Mechanical Action menu. The following table provides more information about the three types of switch and latch behaviors:

Behavior When to Use Example
Switch When Pressed Use as a control that changes the current value as soon as you click the control, and retains the new value until you click the control again. Light switch—The light turns on as soon as you switch the control, and stays in that state until you switch the control again.
Switch When Released Use as a control that changes the current value when you release the mouse button, and retains the new value until you click the control again. Checkbox—The checkbox changes its value only after you release the mouse button, which gives you the ability to reconsider your choice after clicking by moving the cursor away from the checkbox before releasing the mouse button.
Switch Until Released Use as a control that only changes the current value when you click and hold the mouse button down, and reverts to the previous value when you release the mouse button. Doorbell—The bell rings as soon as you press the button, and continues to ring until you release the button.
Latch When Pressed Use as a control that changes the current value as soon as you click the control, and reverts to the previous value after the VI reads the control. Emergency stop button—The button stops the system as soon as you press the button, but resets as soon as the system reads the change in value, allowing for the button to be pressed again.
Latch When Released Use as a control that changes the current value when you release the mouse button, and reverts to the previous value after the VI reads the control. Close button—The button closes the program only after you release the mouse button and the application reads the change in value, which gives you the ability to reconsider your choice after clicking by moving the cursor away from the button before releasing the mouse button.
Latch Until Released Use as a control that only changes the current value when you click and hold the mouse button down. Once you release the mouse button, the value will revert to the previous value after the VI reads the control. Robot movement control—The movement control informs the system of the robot to move the robot while the control is pressed down. Once the control is released, and the system of the robot has read the control, the robot goes back to its previous state of non-movement.
Note  (FPGA Module) On FPGA targets, use Switch When Pressed, Switch When Released, or Switch Until Released as a control that changes the current value once a new value is written from the host VI to the FPGA target, and retains the new value until another value is written from the host VI again. Use Latch When Pressed, Latch When Released, or Latch Until Released as a control that only changes the current value when a new value is written from the host VI to the FPGA target, and reverts to the previous value once the new value has been read by the FPGA target.

Related Information

Changing the Mechanical Action of a Boolean Object

Previewing the Mechanical Action of a Boolean Object

WAS THIS ARTICLE HELPFUL?

Not Helpful