RadioButton

RadioButton (Option Button)

The RadioButton is a control object that allows an operator to select only one option from a group of multiple choices.

While a CheckBox allows multiple options to be checked simultaneously, RadioButton objects are mutually exclusive within a group; selecting one automatically deselects the others.

Common Use Cases
  • Mode Selection: Selecting one of “Manual Mode”, “Auto Mode”, or “Maintenance Mode”.
  • Filtering: Choosing to view either “Active Alarms” or “Historical Alarms” in a list.
  • Parameter Selection: Selecting “Type A”, “Type B”, or “Type C” for a recipe.
Basic Configuration and Operation

Binding RadioButtons bidirectionally to a SCADA tag requires a slightly different approach than other objects:

1. Tag Selection Typically, a single tag (e.g., Machine_Mod_Tag) is used to manage the entire group. This tag holds the value indicating which option is active (e.g., 0 = Manual, 1 = Auto, 2 = Maintenance).

2. Writing Process (Write -> To Tag) When the operator clicks a RadioButton, that button’s Events -> Mouse Down event writes the corresponding value (0, 1, or 2) to the tag.

3. Reading Process (Read -> From Tag) The Checked property of each RadioButton in the Properties panel reads the Machine_Mod_Tag.

  • The “Manual” button’s Checked property is bound to the condition Machine_Mod_Tag == 0.
  • The “Automatic” button’s Checked property is bound to the condition Machine_Mod_Tag == 1.

Properties Panel – Key Properties

Value

  • Tag:
    • Function: This is the dynamic property that determines whether the object is currently selected (True) or not (False).
    • Binding Direction: This property is generally used for reading data from the tag (One-Way: Tag -> Object).

Events

  • Mouse Down:
    • Function: Triggered the moment the operator clicks to select this RadioButton.
    • Use Case: This is the primary event used to write data to the tag (One-Way: Object -> Tag). The Click event calls the Tag -> Write Value function via the Function Dialog to write the value represented by this button (e.g., 1) to the group’s tag.

Advanced Panel – Key Properties

  • Checked (Default Selection)
    • If set to True, this RadioButton appears selected by default when the screen opens.
    • Important: It is recommended that only one button in a group has Checked = True.
  • AutoSize
    • True (Recommended): The size of the object automatically adjusts based on the length of the Text property.

General Usage Example (Two-Way Binding)

Instruction: Binding RadioButtons to Machine_Mode Tag

  1. Add a GroupBox to the screen.
  2. Place three RadioButton objects inside the GroupBox:
    • RadioButton 1: Manual
    • RadioButton 2: Automatic
    • RadioButton 3: Maintenance
  3. SCADA/PLC Tag Definition:
    • Tag: Machine_Mode
    • Values:
      • 0 -> Manual
      • 1 -> Automatic
      • 2 -> Maintenance

      Configuration Steps:

      • Manual RadioButton Settings:
        • Text: “Manual Mode”
        • Events -> Mouse Down: Add a function.
          • Function: Tag
          • Tag: Machine_Mode
          • Value: 0
      • Automatic RadioButton Settings:
        • Text: “Automatic Mode”
        • Events -> Mouse Down: Add a function.
          • Function: Tag
          • Tag: Machine_Mode
          • Value: 1
      • Maintenance RadioButton Settings:
        • Text: “Maintenance Mode”
        • Events -> Mouse Down: Add a function.
          • Function: Tag
          • Tag: Machine_Mode
          • Value: 2

      Result:

      • When the operator clicks a RadioButton, the corresponding value (0, 1, or 2) is written to the PLC.
      • When the PLC changes the Machine_Mode tag value, the corresponding RadioButton automatically becomes selected.
      • When one RadioButton is selected, the others automatically become inactive (standard RadioButton behavior).

      Leave a Reply