Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Changing the Mechanical Action of a Boolean Object

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Boolean controls have six types of mechanical action that allow you to customize Boolean objects to create front panel windows that more closely resemble the behavior of physical instruments.

Note  When you assign a keyboard shortcut to the mechanical action of a Boolean control, the keyboard toggles the value. For example, when you assign a keyboard shortcut to a Boolean control and set the keyboard shortcut to one of the latching mechanical actions, the button unlatches when read.

Complete the following steps to change the mechanical action of a Boolean control.

  1. Add a Boolean control, such as a push button, to the front panel window.

  2. Right-click the Boolean control and select Properties from the shortcut menu to display the Boolean Properties dialog box.
  3. Click the Operation tab of the Boolean Properties dialog box.
  4. Select a button behavior appropriate to the application from the Button behavior list. An explanation of the behavior appears in the Behavior Explanation section, and you can test the selected behavior in the Preview Selected Behavior section.

    In the icons that appear in the Behavior Explanation section, M represents the motion of the mouse button when you operate the control, V represents the output value of the control, and RD represents the point in time the VI reads the control.

    You can select from the following button behaviors:
    • Switch when pressed—Changes the control value each time you click it with the Operating tool. The frequency with which the VI reads the control does not affect this behavior.
    • Switch when released—Changes the control value only after you release the mouse button during a mouse click within the graphical boundary of the control. The frequency with which the VI reads the control does not affect this behavior.
    • Switch until released—Changes the control value when you click it and retains the new value until you release the mouse button. At this time, the control reverts to its default value, similar to the operation of a door buzzer. The frequency with which the VI reads the control does not affect this behavior. You cannot select this behavior for a radio buttons control.
    • Latch when pressed—Changes the control value when you click it and retains the new value until the VI reads it once. At this point, the control reverts to its default value even if you keep pressing the mouse button. This behavior is similar to a circuit breaker and is useful for stopping a While Loop or for getting the VI to perform an action only once each time you set the control. You cannot select this behavior for a radio buttons control.
    • Latch when released—Changes the control value only after you release the mouse button within the graphical boundary of the control. When the VI reads it once, the control reverts to its default value. This behavior works in the same manner as dialog box buttons and system buttons. You cannot select this behavior for a radio buttons control.
    • Latch until released—Changes the control value when you click it and retains the value until the VI reads it once or you release the mouse button, depending on which one occurs last. You cannot select this behavior for a radio buttons control.
Note  You cannot use any latch action for objects with a local variable. If you configure your Boolean value with a latching mechanical action, the Value property and the Value (Signaling) property return an error when the VI is in a non-idle state, such as when the VI is running or reserved to run. Due to race conditions that can occur when you have a Boolean value with latching mechanical action, you cannot programmatically read Boolean values that are set with a latching mechanical action.

Refer to the Mechanical Action VI in the labview\examples\Controls and Indicators\Boolean directory for an example of Boolean control mechanical actions.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit