Button

Button

The Button is the most fundamental and important interaction object used by the operator to control the system. It is used for all “action-based” operations, such as changing a tag’s value, triggering a script, or switching between screens.

This object functions as a Push Button. To create a Toggle Button (Latched Button), you can use the Checkbox object by changing its Appearance setting to Button in the Advanced properties. For more details, see Checkbox.

Common Use Cases
  • Motor/Device Control: Sending a “Start” or “Stop” command to a motor.
  • Value Assignment: Saving a recipe value or resetting a counter.
  • Navigation: Opening/closing a pop-up window or returning to the main screen.
  • Alarm Management: Sending an “Acknowledge” command for a selected alarm.
Basic Configuration and Operation

The functionality of a button can be configured in two main ways:

  1. Event Usage: Assigning a function to the Mouse Up/Down event in the Button’s Properties -> Events panel. This function is executed when the operator presses or releases the button.
  2. Dynamic Tag Binding: Binding the button directly to a BOOL tag. This method is generally used for the “Momentary Button” logic.

Properties Panel – Key Properties

Unlike other objects, the button’s functionality centers around the Value and Events properties.

Value

  • Tag:
    • When you bind a BOOL tag to the Button’s Tag property, the object behaves like a Momentary Button.
    • Runtime Behavior: The tag value is inverted (True becomes False, False becomes True) as long as the button is held down. When released, the tag returns to its previous value.
    • Tip: If you want to make a push-release (Toggle/Latching) button, it is recommended to use the “Button” appearance of the CheckBox object.

Events 

The real power of the button comes from its ability to react to specific mouse actions.

  • Mouse Down (Press Moment)
    • Triggered the moment the mouse button is pressed. Ideal for momentary settings.
  • Mouse Up (Release Moment)
    • Triggered the moment the held mouse button is released. Generally used to end or reset an operation.

Advanced Panel – Key Properties

The Advanced panel determines the static (default) appearance and basic behaviors of the button. Settings made here apply unless overridden by any condition (dynamic color change, etc.) from the Properties panel.

FlatStyle 

Determines the visual style of the button.

  • Standard: Classic Windows button look (3D embossed). 
  • Flat: Flat, modern, and borderless look. 
  • Popup: A style that becomes prominent when hovered over.

Image / ImageAlign

  • Used to add an icon (image) to the button and adjust the position of this image relative to the text (e.g., Left, Right, Center).

Common Usage Examples

Example 1: Basic Start/Stop (Momentary Button)

The fastest Start/Stop method.

  1. Go to the Button’s Properties panel.
  2. Click the empty cell in the Value -> Tag section and open the tag selection screen.
  3. Select and bind the tag you want to control (e.g., Motor_Start_Bit).

Result: In Runtime, the tag becomes True when the button is pressed, and False when released.

Example 2: Button Changing Color and Text Based on Status 

The button is required to show the status of the motor it controls.

  1. Perform the binding as in Example 1.
  2. Go to the Properties -> Text section:
    • Default: “STOP”
    • + New (Condition): If Motor_Status == True then Value: “START”
  3. Go to the Properties -> BackColor section:
    • Default: “Red”
    • + New (Condition): If Motor_Status == True then Value: “Green”
    • Result: The button automatically changes both its text and color according to the Motor_Status tag.

Leave a Reply