Skip to main content
Version: Next

Data Management Examples

Real-world production scenarios showing how to use Data Management for common industrial applications.


Example 1: Production Counting by Time Dimension

Scenario: Track production output by minute, hour, and day from a cumulative counter.

Challenge

  • Raw data: Cumulative counter that increments continuously
  • Need: Net production per time period (minute/hour/day)
  • Issue: Counter may reset to zero

Solution Architecture

Step 1: Create Raw Data Table

Table: Production_Raw

FieldSourceFormula
Cumulative_CountLink to Tag: Counter-
Net_ProductionFormulaCHANGE([Cumulative_Count], 10000)

Trigger: Scheduled every 1 second

Explanation:

  • CHANGE() function calculates the difference from the previous record
  • If the counter resets (negative difference), it automatically adds 10000
  • Result: Net production for each second

Step 2: Create Aggregation Tables

Table: Production_Hourly

FieldSource FieldProcessing
HourRecord TimeGroup by Hour
Total_PartsNet_ProductionSum

Table: Production_Daily

FieldSource FieldProcessing
DayRecord TimeGroup by Day
Total_PartsNet_ProductionSum

Trigger: Real-time Update (or Scheduled daily at 00:01)

Step 3: Create Dashboard

Components:

  1. Dropdown: Select time dimension (Hour/Day)
  2. Table: Display production data
  3. Time Range Filter: Select date range
  4. Bar Chart: Visualize production trends

📷 [Screenshot: Production dashboard with time dimension selector]

Result: Operators can view production by hour or day, with automatic handling of counter resets.


Example 2: Equipment Status Duration Tracking

Scenario: Track how long equipment is in each status (Running, Stopped, Fault) by hour, day, and shift.

Challenge

  • Raw data: Equipment status code (0=Stopped, 1=Running, 2=Fault)
  • Need: Duration in each status per time period
  • Issue: Status changes frequently

Solution Architecture

Step 1: Create Raw Data Table

Table: Equipment_Status_Raw

FieldSourceFormula
StatusLink to Tag: Equipment_Status-
Stopped_DurationFormulaIF([Status] == 0, 1, 0)
Running_DurationFormulaIF([Status] == 1, 1, 0)
Fault_DurationFormulaIF([Status] == 2, 1, 0)

Trigger: Scheduled every 1 second

Explanation:

  • Each status duration field returns 1 if the status matches, 0 otherwise
  • When aggregated, the sum equals the total seconds in that status

Step 2: Create Aggregation Table

Table: Equipment_Status_Hourly

FieldSource FieldProcessing
HourRecord TimeGroup by Hour
Stopped_SecondsStopped_DurationSum
Running_SecondsRunning_DurationSum
Fault_SecondsFault_DurationSum

Optional: Add fields to convert seconds to minutes:

FieldFormula
Stopped_Minutes[Stopped_Seconds] / 60
Running_Minutes[Running_Seconds] / 60
Fault_Minutes[Fault_Seconds] / 60

Step 3: Create Dashboard

Components:

  1. Stacked Bar Chart: Show duration by status and hour
  2. Time Range Filter: Select date range
  3. KPI Cards: Total duration for each status

📷 [Screenshot: Equipment status dashboard with stacked bar chart]

Result: Operators can see equipment utilization and identify downtime patterns.


Example 3: Shift-Based Production Counting

Scenario: Track production by shift, including overnight shifts that span two calendar days.

Challenge

  • Shift configuration: Day Shift (08:00-20:00), Night Shift (20:00-08:00)
  • Need: Production count per shift
  • Issue: Night shift spans two days (20:00 today → 08:00 tomorrow)

Solution Architecture

Step 1: Create Raw Data Table

Table: Production_Raw

FieldSourceFormula
Cumulative_CountLink to Tag: Counter-
Net_ProductionFormulaCHANGE([Cumulative_Count], 10000)
Current_ShiftLink to Tag: System_Shift-
Shift_DateLink to Tag: System_ShiftDate-

Trigger: Scheduled every 1 second

Explanation:

  • System_Shift: System tag that returns current shift name
  • System_ShiftDate: System tag that returns shift date (handles overnight shifts)

Step 2: Create Aggregation Table

Table: Production_By_Shift

FieldSource FieldProcessing
Shift_DateShift_DateGroup by Day
ShiftCurrent_ShiftGroup by Same Value
Total_PartsNet_ProductionSum

Trigger: Scheduled daily at 00:01 (to handle overnight shifts)

⚠️ Important: Use scheduled trigger (not real-time) to ensure overnight shift data is complete.

Step 3: Create Dashboard

Components:

  1. Table: Show production by shift and date
  2. Time Range Filter: Select date range (filter by Shift_Date)
  3. Bar Chart: Compare shifts

📷 [Screenshot: Shift production dashboard]

Result: Production is correctly attributed to shifts, even when shifts span two calendar days.


Example 4: Alarm Count by Shift

Scenario: Count alarms by shift and date for analysis.

Challenge

  • Data source: System alarm history table
  • Need: Alarm count per shift
  • Issue: Determine shift from alarm timestamp

Solution

Table: Alarm_Count_By_Shift

Source Table: Alarm Management - Historical Table (system table)

FieldSource FieldFormulaProcessing
Alarm_DateTrigger Time-Group by Day
Alarm_Hour-HOUR([Trigger Time])-
Shift-IF([Alarm_Hour] < 14, "Day Shift", "Night Shift")Group by Same Value
Alarm_CountAlarm Name-Count

For Non-Integer Shift Times (e.g., 08:15-14:45):

Shift Formula:
IF(
AND(
OR([Alarm_Hour] > 8, AND([Alarm_Hour] == 8, MINUTE([Trigger Time]) >= 15)),
OR([Alarm_Hour] < 14, AND([Alarm_Hour] == 14, MINUTE([Trigger Time]) <= 45))
),
"Day Shift",
"Night Shift"
)

For Overnight Shifts (e.g., 20:00-08:00):

Add field Is_Overnight:

[Alarm_Hour] <= 7

Adjust Alarm_Date:

IF([Is_Overnight] == FALSE, TODAY().AddDays(-1), [Trigger Time])

Dashboard: Stacked bar chart showing alarm count by shift and date.


Best Practices from Examples

Data Collection

  1. Use CHANGE() for Counters: Automatically handles counter resets
  2. Record at Appropriate Frequency: Every second for fast processes, every minute for slow processes
  3. Include Shift Information: Use system tags System_Shift and System_ShiftDate

Aggregation Strategy

  1. Multi-Level Aggregation: Raw → Minute → Hour → Day → Month
  2. Scheduled Triggers for Overnight Shifts: Use daily scheduled triggers instead of real-time
  3. Group by Time First: Group by time dimension before grouping by category

Formula Techniques

  1. Status Duration: Use IF([Status] == X, 1, 0) then sum
  2. Shift Determination: Use HOUR() and MINUTE() functions with IF() logic
  3. Counter Reset Handling: Use CHANGE() function with range parameter

Dashboard Design

  1. Time Range Filters: Always provide date range selection
  2. Multiple Views: Offer hourly, daily, and shift views
  3. KPI Cards: Show key metrics at a glance
  4. Stacked Charts: Use for comparing categories over time

Next Steps