Label
Label
The Label is a fundamental control object used to display text or values that are read-only for the operator and cannot be edited.
It has two main purposes in SCADA systems:
- Static Text: To display headers or descriptions on the screen, such as “Motor Name:” or “Temperature:”.
- Dynamic Data: To display the real-time value of a tag (e.g., “125.5 °C” or “RUNNING”).
The Label does not accept input from the operator; it only provides output.
Basic Configuration and Operation
- For Static Headers: Type the desired text into the Text property and leave it as is.
- For Dynamic Data: The Text property is usually left at its default value (e.g., “0.0”).
- Visual Settings: Settings such as Font, default ForeColor (text color), and TextAlign are configured here.
Properties Panel:
- This is where the Label is connected to a SCADA tag to display “live” data.
- Value / Text: Used to display a tag’s value or mapped text.
- ForeColor / BackColor: Used to change colors based on the value’s status (e.g., changing color during an alarm).
- Visible: Used to make the label visible or hidden under specific conditions (e.g., showing only when an alarm is active).
Properties Panel – Key Properties
This is the main section containing all settings for the value the Label will display on the screen. It defines both what data is displayed and how it is formatted.
Value
- Tag
- Determines the source for the Label. When a tag is selected here, the Label continuously updates to show that tag’s real-time value.
- Decimal Place: If the tag contains a numeric value, this determines how many decimal places to show.
- Tag Value: 123.456
- Decimal Place: 0 → 123
- Decimal Place: 1 → 123.4
- Decimal Place: 2 → 123.45
- Thousand Separator: Uses a separator for thousands. When checked, numbers are divided into groups for better readability.
- If checked:
- Tag Value: 12345678
- Display: 12,345,678 (or 12.345.678 depending on regional settings).
- Unit: Used to automatically append a unit string next to the displayed data. This is purely for display purposes.
- Value: 24.5, Unit: °C
- Display: 24.5 °C
- Text
- While the Value property displays the raw value of the tag, the Text property allows you to display specific text based on that value.
- Function: By using the + New button to add conditions, you determine exactly what the Label writes.
- Use Case: Ideal for converting a digital bit (True/False) into operator-friendly text (e.g., RUNNING/STOPPED).
Advanced Panel – Key Properties
- AutoSize (Automatic Sizing)
- True: The size of the Label (specifically Width) automatically expands or shrinks based on the length of the text inside. This ensures that text of varying lengths, such as “RUNNING” vs. “STOPPED”, always displays correctly.
- False: The Label’s size remains fixed at the pixel value you defined in the Size property. If the text is too long, it will be clipped.
- BorderStyle
- None (Default): No border.
- FixedSingle or Fixed3D: Adds a frame to the Label, making it look like a TextBox, though it remains uneditable.
- TextAlign
- Determines where the text sits within the Label’s frame (e.g., MiddleCenter, MiddleLeft). This is more effective when AutoSize is set to False.
Common Usage Examples
Example 1: Displaying a Value (Using Value – Most Common)
Goal: To show the instant value of a tank level.
- Add a Label_0 to the screen.
- Add a second Label_1 next to it with the text “Level:”.
- Select Label_0 and find the Properties -> Value property.
- Open the tag selection screen and bind the Tank_Level tag.
Result: As the Tank_Level tag value changes (e.g., 82.5), the Label text will automatically update to “82.5”.
Example 2: Displaying Digital Status (Using Text)
Goal: To show a motor’s status as “RUN” or “STOP”.
- Add a Label to the screen.
- Go to the Properties -> Text property of the Label.
- Set the Default value to “STOP”.
- Use + New to add a condition:
- Condition: Motor_State = “true”
- Value: “RUN”
Result: When Motor_State is True, it displays “RUN”; when False, it displays “STOP”.
Example 3: Changing Color Based on Alarm (Using ForeColor)
Goal: To display a temperature value but turn the text red if an alarm occurs.
- Bind the Label to the Heat_Level tag as in Example 1.
- Go to the Properties -> ForeColor (Text Color) property.
- Leave the Default color as “Black” (or ControlText).
- Use + New to add a condition:
- Condition: Heat_Alarm = “true”
- Value: “Red”
Result: The text is black when the temperature is in the normal range. When the alarm bit (Heat_Alarm) becomes True, the Label text turns red.
