Creating Event-Actions
This guide walks you through creating event-action configurations to automate your SCADA system.
Configuration Overview
A complete event-action configuration consists of three parts:
Event Type + Condition + Action
- Event Type: What triggers the automation (button click, alarm, timer, etc.)
- Condition: Optional logic to determine if actions should execute
- Action: What to do when the event occurs
📷 [Screenshot: Event-Action configuration panel showing the three-part structure]
Step 1: Add an Event
For Component Events
- Select the component in the View Editor
- Click the Event tab in the properties panel
- Click Add Event
- Select the event type from the dropdown
📷 [Screenshot: Component event configuration showing event type dropdown]
For View Events
- Click the canvas area (not on any component)
- Click the Event tab
- Click the View tab
- Click Add Event
- Select the event type
📷 [Screenshot: View event configuration panel]
For Global Events
- Click the canvas area in any view
- Click the Event tab
- Click the Global Events tab
- Click Add Event
- Select the event type
📷 [Screenshot: Global event configuration panel]
Step 2: Configure Event Types
Mouse Events
Available for component events:
| Event | Trigger |
|---|---|
| Click | Single left-click on component |
| Double Click | Double left-click on component |
| Right Click | Right-click on component |
| Mouse Down | Mouse button pressed on component |
| Mouse Up | Mouse button released on component |
| Mouse Enter | Mouse cursor enters component area |
| Mouse Leave | Mouse cursor leaves component area |
| Mouse Hover | Mouse stays on component for a moment |
| Long Press | Mouse button held down for extended time |
| Focus | Component receives input focus |
| Blur | Component loses input focus |
Configuration: Simply select the desired mouse event from the dropdown. No additional configuration needed.
Lifecycle Events
Component Load/Exit:
- Component Load: Triggered when the component is loaded on a view
- Component Exit: Triggered when the component is removed (view exit)
View Load/Exit:
- View Load: Triggered when the view finishes loading
- View Exit: Triggered when navigating away from the view
System Startup:
- Triggered when the runtime application starts
Configuration: Select the lifecycle event. No additional configuration needed.
Tag Monitoring Events
Monitor tag value changes and trigger actions based on conditions.
Configuration Steps:
-
Click the Configure icon next to the event
-
Enter an expression in the Expression field:
- Use tag names:
Line1.Temperature - Use operators:
Line1.Temperature > 80 - Use logic:
Line1.Temperature > 80 && Line1.Pressure < 5
- Use tag names:
-
Select the Trigger Condition:
- Becomes True: Expression changes from false/0/empty to true/non-zero/non-empty
- Becomes False: Expression changes from true/non-zero/non-empty to false/0/empty
- True/False Change: Expression toggles between true and false
- Value Change: Expression value changes (any change)
-
Configure Initialization (optional):
- Auto Execute: Execute immediately on load without checking condition
- Execute if Met: Check condition on load and execute if true
- Disabled: Do not check condition on load
📷 [Screenshot: Tag monitoring event configuration dialog]
💡 Tip: For simple tag monitoring, use "Value Change" trigger and directly reference the tag name in the expression.
Example Configurations:
Temperature alarm:
Expression: Line1.Temperature > 80
Trigger: Becomes True
Initialization: Execute if Met
Production counter:
Expression: Line1.ProductCount
Trigger: Value Change
Initialization: Disabled
Multi-condition check:
Expression: Line1.Running == true && Line1.Speed > 100
Trigger: Becomes True
Initialization: Auto Execute
Scheduled Tasks
Execute actions at specific times or intervals.
Configuration Steps:
-
Click the Configure icon
-
Set Event Name (optional)
-
Set Start Time: When the schedule begins
-
Configure Execution Frequency:
- Simple Repeat: Fixed interval (e.g., every 1 hour, every 30 minutes)
- Select time unit: Seconds, Minutes, Hours, Days
- Enter interval value
-
Set End Time (optional): When the schedule stops (leave empty for never)
📷 [Screenshot: Scheduled task configuration dialog]
Example Configurations:
Hourly report:
Start Time: 2024-01-01 00:00:00
Frequency: Every 1 Hour
End Time: (empty - never ends)
Shift change:
Start Time: 2024-01-01 08:00:00
Frequency: Every 8 Hours
End Time: (empty)
Daily backup:
Start Time: 2024-01-01 02:00:00
Frequency: Every 1 Day
End Time: (empty)
⚠️ Caution: Scheduled tasks require the application to remain in the foreground. Minimizing, locking the screen, or sleep mode may affect timer execution. Configure system power settings to "Never sleep" for reliable operation.
Alarm Events
Respond to alarm triggers and recoveries.
Alarm Trigger Configuration:
- Click the Configure icon
- Set Event Name (optional)
- Click Select Alarm Points
- Choose one or more alarm points
- Configure Execute on Load if Alarm Active (optional):
- When enabled, checks if any selected alarm is active on system startup
- If active, executes the actions immediately
📷 [Screenshot: Alarm trigger event configuration]
Alarm Recovery Configuration:
- Click the Configure icon
- Set Event Name (optional)
- Click Select Alarm Points
- Choose one or more alarm points
- Select Recovery Trigger:
- All Recovered: Execute when all selected alarms have recovered
- Any Recovered: Execute when any selected alarm recovers
📷 [Screenshot: Alarm recovery event configuration]
Barcode Scan Events
Handle input from USB barcode scanners.
Configuration Steps:
- Select Barcode Scan event type
- No additional configuration needed
- The scanned barcode content is available as
event.codein conditions and actions
Event Parameter:
event.code: The scanned barcode string
Example Usage:
Condition: event.code.StartsWith("PROD")
Action: Query database for product with code = event.code
💡 Tip: Barcode scan events can be configured at component, view, or global level depending on your needs.
Broadcast Events
Receive and respond to broadcast messages.
Configuration Steps:
- Click the Configure icon
- Enter the Broadcast Content to match
- The event triggers when a matching broadcast is sent
Example:
Broadcast Content: "RefreshData"
When another event sends broadcast "RefreshData",
this event will trigger and execute its actions.
💡 Tip: Use broadcast events to coordinate actions across different views or components without tight coupling.
Component-Specific Events
Some components have unique events:
Input Change (Input controls):
- Triggered when the user changes the input value
- Event parameter:
event.target.value(current control value)
Cell Selection (Table/Report components):
- Triggered when a user selects a table cell
- Event parameters:
event.cell.name: Selected cell field nameevent.cell.value: Selected cell valueevent.row.cells[index].name: Field name of cell in selected rowevent.row.cells[index].value: Field value of cell in selected row
Step 3: Add Conditions (Optional)
Conditions allow you to execute actions only when specific criteria are met.
If...Else Logic
Simple If:
- Click Add Condition below the event
- Select If
- Enter the condition expression
- Add actions under the "If" branch
📷 [Screenshot: Simple If condition configuration]
If...Else:
- Configure the "If" condition as above
- Click the + icon on the condition block
- Select Else
- Add actions under the "Else" branch
📷 [Screenshot: If...Else condition configuration]
Else If (Multiple Conditions):
- Configure the initial "If" condition
- Click the + icon
- Select Else If
- Enter the second condition
- Repeat to add more "Else If" branches
- Optionally add a final "Else" branch
📷 [Screenshot: Multiple Else If conditions]
Switch/Case Logic
For comparing a single expression against multiple values:
- Click Add Condition
- Select Switch
- Enter the Switch Expression (the value to compare)
- Click Add Case
- Enter the Case Value (value to match)
- Add actions for this case
- Repeat to add more cases
- Configure the Default case for unmatched values
📷 [Screenshot: Switch/Case condition configuration]
Example:
Switch Expression: ProductType
Case 1: "TypeA"
Actions: Load Recipe A, Set parameters...
Case 2: "TypeB"
Actions: Load Recipe B, Set parameters...
Default:
Actions: Show error message
Writing Condition Expressions
Condition expressions support:
Comparison Operators:
==(equal),!=(not equal)>,<,>=,<=
Logical Operators:
&&(AND),||(OR),!(NOT)
Tag References:
- Use tag names directly:
Line1.Temperature - Access tag properties:
Line1.Temperature.Quality
Event Parameters:
- Access event data:
event.target.value,event.code
Functions:
- String functions:
.Contains(),.StartsWith(),.EndsWith() - Math functions:
Math.Abs(),Math.Max(),Math.Min()
Example Expressions:
Line1.Temperature > 80 && Line1.Temperature < 100
event.target.value != ""
ProductCode.StartsWith("PROD") && ProductCode.Length == 10
Line1.Running == true || Line2.Running == true
Math.Abs(Line1.Temperature - Line2.Temperature) > 5
💡 Tip: Click the expression field to open the Expression Builder for a visual interface with tag selection and function reference.
Step 4: Add Actions
Actions define what happens when the event triggers (and conditions are met).
Adding Actions
-
Click + Action below the event or condition
-
Select the Target type:
- Component: Control a specific component
- View: Control view navigation and display
- System: System-level operations
- Recipe: Recipe management operations
-
Select the specific target (component, view, etc.)
-
Select the Action type
-
Configure action parameters
📷 [Screenshot: Action configuration panel showing target and action selection]
Component Actions
Control component appearance, behavior, and properties.
Layout & Size:
| Action | Parameters | Description |
|---|---|---|
| Resize | Mode: Percentage / Absolute Width, Height | Change component size |
| Move | Mode: Relative / Absolute X, Y | Change component position |
| Rotate | Mode: Relative / Absolute Angle, Offset X, Offset Y | Rotate component |
Text:
| Action | Parameters | Description |
|---|---|---|
| Text Style | Color, Font Size, Bold, Italic, Underline, Alignment, Letter Spacing, Line Spacing | Change text appearance |
| Text Content | Text | Change displayed text |
Appearance:
| Action | Parameters | Description |
|---|---|---|
| Background | Color | Change background color |
| Border | Color, Width, Style | Change border appearance |
| Shadow | Mode, Horizontal, Vertical, Blur, Size, Color | Add/modify shadow effect |
| Corner Radius | Radius | Change corner rounding |
Visibility:
| Action | Parameters | Description |
|---|---|---|
| Show/Hide | Mode: Show / Hide / Toggle | Control component visibility |
| Opacity | Opacity (0-100%) | Change transparency |
| Blink | Mode: Start / Stop Speed: Slow / Medium / Fast | Make component blink |
Interaction:
| Action | Parameters | Description |
|---|---|---|
| Enable/Disable | Mode: Enable / Disable / Toggle | Control if component is interactive |
| Trigger Event | Event | Trigger another event on this component |
Component-Specific Actions:
| Action | Applies To | Description |
|---|---|---|
| Set Image | Image component | Change displayed image |
| Get Control Value to Tag | Input controls | Read control value to a tag |
| Set Control Value | Input controls | Set control value programmatically |
| Set Container View | View container | Change the view displayed in container |
| Set Quick Time Filter | Quick time filter | Set time range selection |
| Set Relative Time Filter | Relative time filter | Set relative time parameters |
View Actions
Control view navigation and display.
| Action | Parameters | Description |
|---|---|---|
| Navigate to View | Target View | Switch to a different view |
| Close View | - | Close current popup or all popups |
| Reload View | - | Refresh current view |
| Go Back | - | Return to previous view |
| Popup View | Target View, Title, Size, Modal/Free, Show Close Button | Open view in popup window |
| Export View | Format (PDF/Image), Paper Size, Layout, File Name, Save Path | Export view to file |
| Print View | - | Send view to printer |
| Export Chart Data | Target Chart, Format, Content, File Name, Save Path | Export chart data to Excel |
💡 Tip: View actions operate on the window level where the event is triggered (main window vs. popup window).
System Actions
System-level operations and control.
| Action | Parameters | Description |
|---|---|---|
| System Notification | Message, Type (Info/Warning/Error) | Show toast notification |
| Set Tag Value | Tag, Value | Write value to a tag |
| Wait | Duration (ms) | Pause before next action |
| Send Broadcast | Broadcast Content | Send broadcast message |
| Execute Script | Script | Run C# script |
| Call API | API Configuration | Make HTTP request |
| Data Table Operation | Operation, Table, Parameters | Insert/Update/Delete records |
| Query to Tags | Query, Tag Mappings | Query database and write to tags |
| Authentication | Auth Method | Trigger custom authentication |
| Virtual Keyboard | Mode: Open / Close | Control virtual keyboard |
| Play Audio | Audio File, Loop | Play/stop audio |
| Switch Language | Language | Change system language |
| Exit Application | - | Close the application |
| Minimize | - | Minimize to system tray |
| Shutdown | - | Close application and shutdown computer |
Recipe Actions
Manage recipe configurations (see Recipe Management guide for details).
| Action | Description |
|---|---|
| Switch Recipe Set | Change active recipe set |
| Switch to First Recipe | Load first recipe in set |
| Switch to Previous Recipe | Load previous recipe |
| Switch to Next Recipe | Load next recipe |
| Switch to Last Recipe | Load last recipe in set |
| Switch Recipe | Load specific recipe |
| Add Recipe | Create new recipe |
| Rename Recipe | Change recipe name |
| Delete Recipe | Remove recipe |
| Save Recipe | Save current parameters |
| Read Parameters from Tags | Update recipe from tag values |
| Apply Recipe | Apply recipe to equipment |
| Create Copy | Duplicate current recipe |
Step 5: Manage Events and Actions
Event Operations
Enable/Disable Event:
- Click the toggle switch on the event
- Disabled events do not trigger
Delete Event:
- Hover over the event
- Click the delete icon
- Confirm deletion
Reorder Events:
- Hover over the event
- Click the reorder icon
- Drag to new position
Copy/Paste Event:
- Hover over the event
- Click the copy icon
- Click "Paste Event" button or paste icon on another event
Expand/Collapse All:
- Hover over the "Event" tab
- Click the expand/collapse all icon
Action Operations
Reorder Actions:
- Hover over the action
- Click the reorder icon
- Drag to new position
💡 Tip: Actions execute sequentially from top to bottom. Place critical actions first.
Delete Action:
- Hover over the action
- Click the delete icon
Copy/Paste Action:
- Hover over the action
- Click the copy icon
- Click paste icon on another action or condition
Condition Operations
Add Condition Branch:
- Click the + icon on the condition block
- Select branch type (Else, Else If, Case)
Clone/Delete Condition:
- Click the clone icon to duplicate
- Click the delete icon to remove
Reorder Conditions:
- Hover over the condition
- Click the reorder icon
- Drag to new position
Common Patterns
Pattern 1: Button-Triggered Action
Scenario: Click a button to start equipment.
Event: Button Click
Condition: Equipment.ReadyToStart == true
Actions:
1. Set Tag Value: Equipment.StartCommand = true
2. System Notification: "Equipment starting..."
3. Wait: 1000ms
4. Navigate to View: "Equipment Monitor"
Pattern 2: Alarm Response
Scenario: When temperature alarm triggers, send notification and log event.
Event: Alarm Trigger (Temperature High)
Condition: (none)
Actions:
1. System Notification: "Temperature alarm triggered!"
2. Data Table Operation: Insert record to alarm log
3. Play Audio: alarm_sound.wav
4. Send Broadcast: "TemperatureAlarm"
Pattern 3: Scheduled Report
Scenario: Generate hourly production report.
Event: Scheduled Task (Every 1 Hour)
Condition: Production.LineRunning == true
Actions:
1. Query to Tags: Get production data for last hour
2. Navigate to View: "Production Report"
3. Wait: 2000ms
4. Export View: PDF, "Report_{timestamp}.pdf"
5. System Notification: "Report generated"
Pattern 4: Barcode-Driven Workflow
Scenario: Scan barcode to load product information.
Event: Barcode Scan
Condition: event.code.StartsWith("PROD")
Actions:
1. Query to Tags: SELECT * FROM Products WHERE Code = event.code
2. If: Product.Found == true
- Set Control Value: ProductName = Product.Name
- Set Control Value: RecipeID = Product.RecipeID
- System Notification: "Product loaded"
3. Else:
- System Notification: "Product not found", Error
Pattern 5: Multi-Step Process
Scenario: Complex production sequence with multiple steps.
Event: Button Click (Start Process)
Condition: (none)
Actions:
1. System Notification: "Starting process..."
2. Set Tag Value: Step1.Start = true
3. Wait: 5000ms
4. If: Step1.Complete == true
- Set Tag Value: Step2.Start = true
- Wait: 5000ms
5. If: Step2.Complete == true
- Set Tag Value: Step3.Start = true
- Wait: 5000ms
6. If: Step3.Complete == true
- System Notification: "Process complete!"
- Send Broadcast: "ProcessComplete"
7. Else:
- System Notification: "Process failed", Error
Best Practices
Event Configuration
Use Descriptive Names:
- Give events meaningful names that describe their purpose
- Example: "Temperature Alarm Response" instead of "Event 1"
Keep Events Focused:
- Each event should handle a single responsibility
- Split complex logic into multiple events
Avoid Circular Triggers:
- Never create event loops (A triggers B, B triggers A)
- Use broadcast events for complex coordination
Condition Design
Test Conditions Thoroughly:
- Verify conditions work with expected and edge case values
- Use the expression builder to validate syntax
Use Appropriate Logic:
- Use If...Else for binary decisions
- Use Switch/Case for multiple value comparisons
- Combine related conditions with logical operators
Action Sequencing
Order Matters:
- Actions execute top to bottom
- Place critical actions first
- Use Wait actions when timing is important
Handle Asynchronous Operations:
- Add Wait actions after operations that take time
- Example: Wait after writing tags before reading them back
Provide User Feedback:
- Use System Notifications for important operations
- Show progress for long-running actions
Performance
Optimize Tag Monitoring:
- Use "Value Change" trigger instead of continuous polling
- Monitor only necessary tags
- Avoid monitoring high-frequency tags unless required
Minimize Action Count:
- Combine related operations when possible
- Use scripts for complex logic instead of many small actions
Test Before Deployment:
- Test events in development environment
- Verify performance with realistic data
- Check for memory leaks in long-running events
Troubleshooting
Event Not Triggering
Check Event Status:
- Verify event is enabled (toggle switch is on)
- Check if event scope is correct (component/view/global)
Verify Event Configuration:
- For tag monitoring: Check expression syntax and trigger condition
- For scheduled tasks: Verify start time and frequency
- For alarm events: Confirm alarm points are selected
Check Initialization Settings:
- For tag monitoring: Verify initialization mode
- Ensure tags exist and have valid values
Condition Not Working
Validate Expression Syntax:
- Open expression builder to check for errors
- Verify tag names are correct
- Check operator usage (== vs =, && vs &)
Check Tag Values:
- Use tag monitoring to verify actual tag values
- Ensure tag data types match condition expectations
- Check for null or empty values
Actions Not Executing
Verify Action Order:
- Check if actions are in correct sequence
- Ensure Wait actions are used where needed
Check Target Availability:
- For component actions: Verify component exists and is accessible
- For view actions: Ensure target view exists
- For data operations: Confirm table and field names
Review Error Messages:
- Check system logs for error details
- Look for notification messages during execution
Performance Issues
Too Many Events:
- Reduce number of active events
- Disable unused events
- Combine related events
High-Frequency Triggers:
- Adjust tag monitoring trigger conditions
- Increase scheduled task intervals
- Use debouncing for rapid events
Long-Running Actions:
- Move complex logic to scripts
- Use asynchronous operations
- Optimize database queries
Next Steps
Now that you know how to create event-actions, explore:
- Scripts Reference: Complete reference of all event types, actions, and system commands
- Understanding Tags: Learn more about tag monitoring and variable operations
- Understanding Data Management: Work with data tables in actions
Related Topics
- Understanding Scripts: Learn about the Scripts system architecture
- Creating Alarms: Configure alarm events
- Creating Views: Design views with interactive components