TextBox

TextBox

The TextBox is a standard input field that allows the operator to enter alphanumeric data (text, numbers, symbols) into the system using the keyboard.
Unlike a Label (read-only) or NumericUpDown (numeric only), the TextBox is designed for free-form text entry.

Common Use Cases
  • Data Entry: Entering a recipe name, batch number, or operator name.
  • Parameter Adjustment: Sending a value to a String type tag in a PLC.
  • Password Entry: Providing password entry by hiding entered characters (e.g., *****).
Basic Configuration of the TextBox

1. Advanced Panel This contains the most critical settings determining the object’s basic behavior.
2. Properties Panel This ensures the text box exchanges “live” data with a SCADA tag.

Properties Panel – Key Properties

Value

  • Tag:
    • Function: This is a two-way link connecting the text inside the box to a tag.
    • Read (Tag -> Object): If the linked tag (e.g., Receipt_Name) is changed to “Receipt_A” by a script or PLC, the TextBox automatically displays this text.
    • Write (Object -> Tag): If the operator types “Receipt_B” into the box and presses Enter (or loses focus), the value “Receipt_B” is written to the Receipt_Name tag.

Advanced Panel – Key Properties

PasswordChar If not empty (e.g., set to *), all characters entered into the box appear as this character.

  • MultiLine
    • If True, the Enter key moves to a new line.
    • If False (default), the Enter key usually acts like a Click event or confirms the entry.
  • ScrollBars
    • If MultiLine = True, determines which scrollbars (Vertical, Horizontal, Both) will be visible.
  • MaxLength
    • Restricts the number of characters the operator can enter (e.g., 32767 is default).
  • CharacterCasing
    • Upper: Automatically converts whatever the operator types (e.g., “abc”) to UPPERCASE (“ABC”).
    • Lower: Automatically converts to lowercase (“abc”).
    • Normal: Leaves the text exactly as entered.
  • ReadOnly
    • If True, the operator cannot change the text. They can only select and copy the text.

Common Usage Examples

Example 1: Basic Value Entry

  1. Drag and drop a TextBox object onto the design screen.
  2. Bind the object’s Properties → Value property to a SCADA tag (e.g., Tag_Setpoint).
  3. Runtime Behavior:
  • The operator can enter values directly into this box.
  • If the bound tag is an integer, only numeric input is accepted.
  • If the bound tag is a string, text input is allowed.

Result: The TextBox allows input appropriate to the data type of the bound tag, and the entered value is automatically written to the tag.

Example 2: Password Entry

  1. Add a TextBox object to the design screen.
  2. Define the following values in the Advanced panel:
    • PasswordChar: * (Ensures entered characters are displayed as asterisks).
    • MaxLength: 16 (Limits entry to a maximum of 16 characters).
  3. Bind Properties -> Value to the User_password (String) tag.

      Result: When the operator types “Admin123” at runtime, “********” appears on the screen. However, the value “Admin123” (unencrypted raw text) is written to the User_password tag.

      Example 3: Serial Number Entry (Auto UPPERCASE)

      1. Add a TextBox object to the design screen.
      2. Define the following values in the Advanced panel:
        • CharacterCasing: Upper
        • MaxLength: 12
      3. Bind Properties -> Value to the Product_SeriNo (String) tag.

          Result: Even if the operator types “sn-123-ab”, the TextBox content instantly updates to “SN-123-AB”. The uppercase value (“SN-123-AB”) is also written to the tag.

          Leave a Reply