Skip to main content
Version: Next

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

  1. Select the component in the View Editor
  2. Click the Event tab in the properties panel
  3. Click Add Event
  4. Select the event type from the dropdown

📷 [Screenshot: Component event configuration showing event type dropdown]

For View Events

  1. Click the canvas area (not on any component)
  2. Click the Event tab
  3. Click the View tab
  4. Click Add Event
  5. Select the event type

📷 [Screenshot: View event configuration panel]

For Global Events

  1. Click the canvas area in any view
  2. Click the Event tab
  3. Click the Global Events tab
  4. Click Add Event
  5. Select the event type

📷 [Screenshot: Global event configuration panel]


Step 2: Configure Event Types

Mouse Events

Available for component events:

EventTrigger
ClickSingle left-click on component
Double ClickDouble left-click on component
Right ClickRight-click on component
Mouse DownMouse button pressed on component
Mouse UpMouse button released on component
Mouse EnterMouse cursor enters component area
Mouse LeaveMouse cursor leaves component area
Mouse HoverMouse stays on component for a moment
Long PressMouse button held down for extended time
FocusComponent receives input focus
BlurComponent 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:

  1. Click the Configure icon next to the event

  2. 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
  3. 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)
  4. 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:

  1. Click the Configure icon

  2. Set Event Name (optional)

  3. Set Start Time: When the schedule begins

  4. 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
  5. 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:

  1. Click the Configure icon
  2. Set Event Name (optional)
  3. Click Select Alarm Points
  4. Choose one or more alarm points
  5. 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:

  1. Click the Configure icon
  2. Set Event Name (optional)
  3. Click Select Alarm Points
  4. Choose one or more alarm points
  5. 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:

  1. Select Barcode Scan event type
  2. No additional configuration needed
  3. The scanned barcode content is available as event.code in 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:

  1. Click the Configure icon
  2. Enter the Broadcast Content to match
  3. 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 name
    • event.cell.value: Selected cell value
    • event.row.cells[index].name: Field name of cell in selected row
    • event.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:

  1. Click Add Condition below the event
  2. Select If
  3. Enter the condition expression
  4. Add actions under the "If" branch

📷 [Screenshot: Simple If condition configuration]

If...Else:

  1. Configure the "If" condition as above
  2. Click the + icon on the condition block
  3. Select Else
  4. Add actions under the "Else" branch

📷 [Screenshot: If...Else condition configuration]

Else If (Multiple Conditions):

  1. Configure the initial "If" condition
  2. Click the + icon
  3. Select Else If
  4. Enter the second condition
  5. Repeat to add more "Else If" branches
  6. Optionally add a final "Else" branch

📷 [Screenshot: Multiple Else If conditions]

Switch/Case Logic

For comparing a single expression against multiple values:

  1. Click Add Condition
  2. Select Switch
  3. Enter the Switch Expression (the value to compare)
  4. Click Add Case
  5. Enter the Case Value (value to match)
  6. Add actions for this case
  7. Repeat to add more cases
  8. 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

  1. Click + Action below the event or condition

  2. Select the Target type:

    • Component: Control a specific component
    • View: Control view navigation and display
    • System: System-level operations
    • Recipe: Recipe management operations
  3. Select the specific target (component, view, etc.)

  4. Select the Action type

  5. Configure action parameters

📷 [Screenshot: Action configuration panel showing target and action selection]

Component Actions

Control component appearance, behavior, and properties.

Layout & Size:

ActionParametersDescription
ResizeMode: Percentage / Absolute
Width, Height
Change component size
MoveMode: Relative / Absolute
X, Y
Change component position
RotateMode: Relative / Absolute
Angle, Offset X, Offset Y
Rotate component

Text:

ActionParametersDescription
Text StyleColor, Font Size, Bold, Italic, Underline, Alignment, Letter Spacing, Line SpacingChange text appearance
Text ContentTextChange displayed text

Appearance:

ActionParametersDescription
BackgroundColorChange background color
BorderColor, Width, StyleChange border appearance
ShadowMode, Horizontal, Vertical, Blur, Size, ColorAdd/modify shadow effect
Corner RadiusRadiusChange corner rounding

Visibility:

ActionParametersDescription
Show/HideMode: Show / Hide / ToggleControl component visibility
OpacityOpacity (0-100%)Change transparency
BlinkMode: Start / Stop
Speed: Slow / Medium / Fast
Make component blink

Interaction:

ActionParametersDescription
Enable/DisableMode: Enable / Disable / ToggleControl if component is interactive
Trigger EventEventTrigger another event on this component

Component-Specific Actions:

ActionApplies ToDescription
Set ImageImage componentChange displayed image
Get Control Value to TagInput controlsRead control value to a tag
Set Control ValueInput controlsSet control value programmatically
Set Container ViewView containerChange the view displayed in container
Set Quick Time FilterQuick time filterSet time range selection
Set Relative Time FilterRelative time filterSet relative time parameters

View Actions

Control view navigation and display.

ActionParametersDescription
Navigate to ViewTarget ViewSwitch to a different view
Close View-Close current popup or all popups
Reload View-Refresh current view
Go Back-Return to previous view
Popup ViewTarget View, Title, Size, Modal/Free, Show Close ButtonOpen view in popup window
Export ViewFormat (PDF/Image), Paper Size, Layout, File Name, Save PathExport view to file
Print View-Send view to printer
Export Chart DataTarget Chart, Format, Content, File Name, Save PathExport 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.

ActionParametersDescription
System NotificationMessage, Type (Info/Warning/Error)Show toast notification
Set Tag ValueTag, ValueWrite value to a tag
WaitDuration (ms)Pause before next action
Send BroadcastBroadcast ContentSend broadcast message
Execute ScriptScriptRun C# script
Call APIAPI ConfigurationMake HTTP request
Data Table OperationOperation, Table, ParametersInsert/Update/Delete records
Query to TagsQuery, Tag MappingsQuery database and write to tags
AuthenticationAuth MethodTrigger custom authentication
Virtual KeyboardMode: Open / CloseControl virtual keyboard
Play AudioAudio File, LoopPlay/stop audio
Switch LanguageLanguageChange 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).

ActionDescription
Switch Recipe SetChange active recipe set
Switch to First RecipeLoad first recipe in set
Switch to Previous RecipeLoad previous recipe
Switch to Next RecipeLoad next recipe
Switch to Last RecipeLoad last recipe in set
Switch RecipeLoad specific recipe
Add RecipeCreate new recipe
Rename RecipeChange recipe name
Delete RecipeRemove recipe
Save RecipeSave current parameters
Read Parameters from TagsUpdate recipe from tag values
Apply RecipeApply recipe to equipment
Create CopyDuplicate 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: