Skip to main content
Version: Next

Configuring Triggers and Formulas

This guide covers how to configure trigger conditions for data recording and use calculation formulas to process data.


Configure Trigger Conditions

Trigger conditions determine when data is recorded. You can configure multiple triggers for a single table - data is recorded whenever any trigger condition is met.

Trigger Type 1: Tag Trigger

Record data when a tag expression becomes true.

Configuration Steps:

  1. Click Trigger Configuration
  2. Click AddTag Trigger
  3. Click Configure Expression
  4. Build a logical expression using tags and operators
  5. Select the Result Type:
    • Becomes True: Trigger once when expression changes from false to true
    • Becomes False: Trigger once when expression changes from true to false
    • True/False Change: Trigger on any change
  6. (Optional) Set Repeat Frequency: Trigger repeatedly while condition remains true
  7. Click Confirm

📷 [Screenshot: Tag Trigger configuration dialog]

Example Expressions:

Use CaseExpressionResult Type
Record when part completes{Part_Complete} == 1Becomes True
Record when machine stops{Machine_Running} == 0Becomes True
Record on status change{Status} != PREVALUE({Status})True/False Change
Record when temp exceeds limit{Temperature} > 80Becomes True

Trigger Type 2: Scheduled Trigger

Record data at specific time intervals.

Configuration Steps:

  1. Click Trigger Configuration
  2. Click AddScheduled Trigger
  3. Set the Start Time
  4. Set the Repeat Frequency:
    • Every X seconds/minutes/hours
    • Daily at specific time
    • Weekly on specific days
  5. (Optional) Add a Condition: Only trigger if expression is true
  6. Click Confirm

Example Schedules:

Use CaseStart TimeRepeat FrequencyCondition
Record temp every minuteNowEvery 1 minuteNone
Record production at shift end14:00Daily{Production_Active} == 1
Record energy hourly00:00Every 1 hourNone

Trigger Type 3: Field Change Trigger

Record data when a field value changes.

Configuration Steps:

  1. Click Trigger Configuration
  2. Click AddField Change Trigger
  3. Select one or more fields to monitor
  4. (Optional) Add a Condition
  5. Click Confirm

Use Case: Record a new row whenever the product code changes.

Trigger Type 4: Alarm Trigger

Record data when an alarm activates.

Configuration Steps:

  1. Click Trigger Configuration
  2. Click AddAlarm Trigger
  3. Select one or more alarm points
  4. Set Repeat Frequency: Continue recording while alarm is active
  5. Click Confirm

Use Case: Create a "fault snapshot" by recording key parameters every 5 seconds while an alarm is active.

Trigger Type 5: Tag Value Change Trigger

Record data when specific tags change value.

Configuration Steps:

  1. Click Trigger Configuration
  2. Click AddTag Value Change Trigger
  3. Select one or more tags to monitor
  4. Click Confirm

Use Case: Record data whenever equipment status changes (Running → Stopped → Fault).


Using Calculation Formulas

Calculation formulas process raw data to create meaningful metrics.

Formula Syntax

ElementDescriptionExample
Field ReferenceReference another field[Temperature], [Cycle_Time]
OperatorMathematical or logical operator+, -, *, /, >, <, ==
FunctionBuilt-in functionSUM(), IF(), TEXT()
ConstantFixed value100, "OK", TRUE

Common Operators

OperatorDescriptionExample
+Addition[A] + [B]
-Subtraction[End_Time] - [Start_Time]
*Multiplication[Quantity] * [Unit_Price]
/Division[Good_Parts] / [Total_Parts]
>Greater than[Temperature] > 80
==Equal to[Status] == "Running"
&&Logical AND[Temp] > 80 && [Pressure] > 50
||Logical OR[Alarm1] == 1 || [Alarm2] == 1

Commonly Used Functions

Logical Functions

FunctionSyntaxExample
IFIF(condition, true_value, false_value)IF([Score] > 60, "Pass", "Fail")
ANDAND(expr1, expr2, ...)AND([Temp] > 80, [Pressure] > 50)
OROR(expr1, expr2, ...)OR([Status] == "Fault", [Status] == "Error")

Numeric Functions

FunctionSyntaxExample
SUMSUM(val1, val2, ...)SUM(10, 20, 30) = 60
AVERAGEAVERAGE(val1, val2, ...)AVERAGE(10, 20, 30) = 20
ROUNDROUND(number, digits)ROUND(3.14159, 2) = 3.14
ABSABS(number)ABS(-5) = 5

Text Functions

FunctionSyntaxExample
CONCATENATECONCATENATE(str1, str2, ...)CONCATENATE("Line", "1") = "Line1"
TEXTTEXT(value, format)TEXT(TODAY(), "yyyy-MM-dd") = "2024-01-15"
UPPERUPPER(text)UPPER("abcd") = "ABCD"
LOWERLOWER(text)LOWER("ABCD") = "abcd"

Date Functions

FunctionSyntaxExample
TODAYTODAY()Current date
NOWNOW()Current date and time
YEARYEAR(date)YEAR("2024-01-15") = 2024
MONTHMONTH(date)MONTH("2024-01-15") = 1
DAYDAY(date)DAY("2024-01-15") = 15
HOURHOUR(time)HOUR("14:30:00") = 14

Special Functions

FunctionSyntaxDescription
PREVALUEPREVALUE(field)Get previous record value
CHANGECHANGE(field, range)Calculate change from previous value

Formula Examples

Calculate Yield:

[Good_Parts] / [Total_Parts] * 100

Calculate OEE:

([Availability] * [Performance] * [Quality]) / 10000

Determine Shift:

IF(HOUR([Record_Time]) < 14, "Day Shift", "Night Shift")

Calculate Duration in Minutes:

DATEDIF([Start_Time], [End_Time], "M")

Format Date:

TEXT([Record_Time], "yyyy-MM-dd HH:mm:ss")

Calculate Energy Cost:

[Energy_Consumption] * [Unit_Price]

Detect Counter Reset:

IF([Current_Count] < PREVALUE([Current_Count]), 
[Current_Count] + 10000,
[Current_Count] - PREVALUE([Current_Count]))

Calculate Net Production:

CHANGE([Cumulative_Count], 10000)

💡 Tip: Click Validate in the formula editor to check for syntax errors before saving.


Best Practices

Trigger Configuration

Choose the Right Trigger:

  • Use Tag Trigger for event-based recording (part complete, alarm)
  • Use Scheduled Trigger for periodic sampling (temperature, pressure)
  • Use Field Change Trigger for status tracking (product code change)
  • Combine multiple triggers for comprehensive data capture

Avoid Over-Triggering:

  • Don't record data more frequently than needed
  • Use aggregation tables instead of high-frequency raw data
  • Consider storage and performance impact

Formula Best Practices

Keep Formulas Simple:

  • Break complex calculations into multiple fields
  • Avoid nested formulas (> 3 levels deep)
  • Document formula logic in field descriptions

Error Handling:

  • Handle division by zero: IF([Total] == 0, 0, [Good] / [Total])
  • Check for null values: IF([Field] == NULL, 0, [Field])
  • Validate data types match formula expectations

Performance:

  • Use aggregation instead of complex formulas when possible
  • Test formulas with sample data before deployment
  • Monitor system resources during peak archiving periods

Next Steps