Master the display controls toolbox. Add buttons, gauges, charts, and other interactive elements to create rich operator interfaces.
Overview
Master the display controls toolbox. Add buttons, gauges, charts, and other interactive elements to create rich operator interfaces.
What You'll LearnDisplays - Add Controls (Tutorial) teaches you to:
- Use basic controls
- Configure control properties
- Bind controls to tags
- Create control interactions
Prerequisites:
In this page:
Table of Contents |
---|
maxLevel | 2 |
---|
minLevel | 2 |
---|
indent | 10px |
---|
exclude | Steps |
---|
style | none |
---|
|
- Display created
- Tags configured
Step 1: Open display in Draw editor.
Button:
- Drag Button from toolbox
- Properties:
- Text: "Start Motor"
- Width: 120
- Height: 40
- Click event:
csharp
@Tag.Motor1_Start = true;
Toggle Switch:
- Bind to:
@Tag.Motor1_Enable
- On Text: "Enabled"
- Off Text: "Disabled"
Numeric Input:
- Control: NumericTextBox
- Bind to:
@Tag.Setpoint
- Min: 0, Max: 100
- Format: "0.0"
Step 2:
Display Controls
Text Display:
- Control: TextBlock
- Text:
@Tag.Temperature.ToString("F1") + " °C"
- Font Size: 24
- Update: On tag change
Progress Bar:
- Bind Value:
@Tag.Tank_Level
- Maximum: 100
- Color: Blue → Yellow → Red (by ranges)
Digital Indicator:
- Control: CheckBox (read-only)
- Bind:
@Tag.Pump_Running
- Custom text: "Running" / "Stopped"
Step 3:
Gauge Controls
Circular Gauge:
- Add CircularGauge
- Configure:
- Value:
@Tag.Pressure
- Min: 0, Max: 150
- Major Ticks: 10
- Ranges:
- Green: 0-100
- Yellow: 100-120
- Red: 120-150
Linear Gauge:
- Orientation: Vertical
- Height: 300
- Bind:
@Tag.Tank_Level
- Show scale and value
Step 4:
Chart Controls
Trend Chart:
- Add TrendChart
- Configure pens:
- Pen1: Temperature (Blue)
- Pen2: Pressure (Red)
- Time span: 1 hour
- Enable zoom/pan
Bar Chart:
- Data: Production by shift
- Categories: Shift 1, 2, 3
- Values: Bind to tags
- Update: Every minute
Pie Chart:
- Data source: Query result
- Value field: "Quantity"
- Label field: "Product"
Step 5: Data Grid
DataGrid
- Add DataGrid
- Configure columns:
| Batch ID | Product | Quantity | Status |
- Data source options:
- Tag array
- Query result
- Script data table
Step 6:
Container Controls
Tab Control:
- Add TabControl
- Create tabs:
- Overview
- Details
- Trends
- Alarms
- Add content to each tab
Group Box:
- Title: "Motor Controls"
- Border: Solid
- Add related controls inside
Step 7: Media Controls
Images
Image Display:
- Add Image control
- Dynamic source:
csharp
@Tag.AlarmActive ? "alarm.png" : "normal.png"
Web Browser:
- URL: Company dashboard
- Or display PDF reports
Step 8:
Advanced Interactions
ComboBox with Database:
csharp
// Populate from query
ComboBox1.ItemsSource = @Dataset.Query.Products.ResultData;
ComboBox1.DisplayMember = "ProductName";
ComboBox1.ValueMember = "ProductID";
Conditional Visibility:
csharp
// Show/hide based on user level
Panel1.Visibility = @Client.UserGroup == "Supervisor"
? Visibility.Visible
: Visibility.Collapsed;
Step 9: Custom Properties
Dynamic Animations
Add dynamics to any control:
- Right-click control
- Select Dynamics
- Add:
- Visibility: Show/hide by condition
- Position: Move based on value
- Size: Resize dynamically
- Color: Change by state
- Rotation: Rotate by angle
Step 10: Control Templates
Smart Symbols
Create reusable control sets:
- Group controls
- Right-click → Create Symbol
- Add parameters
- Save to library
- Reuse across displays
- Limit controls per display
- Use visibility to hide unused elements
- Optimize binding expressions
- Use appropriate update rates
Best Practices
- Consistent control styling
- Clear labeling
- Appropriate control for data type
- Group related controls
- Test all interactions
- Consider touch screen if applicable
Next Steps
- [Create Canvas Animations] - Advanced animations
- [Working with Symbols] - Reusable components
- [Create Dashboards] - Executive displays