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
| Field | Source | Formula |
|---|---|---|
Cumulative_Count | Link to Tag: Counter | - |
Net_Production | Formula | CHANGE([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
| Field | Source Field | Processing |
|---|---|---|
Hour | Record Time | Group by Hour |
Total_Parts | Net_Production | Sum |
Table: Production_Daily
| Field | Source Field | Processing |
|---|---|---|
Day | Record Time | Group by Day |
Total_Parts | Net_Production | Sum |
Trigger: Real-time Update (or Scheduled daily at 00:01)
Step 3: Create Dashboard
Components:
- Dropdown: Select time dimension (Hour/Day)
- Table: Display production data
- Time Range Filter: Select date range
- 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
| Field | Source | Formula |
|---|---|---|
Status | Link to Tag: Equipment_Status | - |
Stopped_Duration | Formula | IF([Status] == 0, 1, 0) |
Running_Duration | Formula | IF([Status] == 1, 1, 0) |
Fault_Duration | Formula | IF([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
| Field | Source Field | Processing |
|---|---|---|
Hour | Record Time | Group by Hour |
Stopped_Seconds | Stopped_Duration | Sum |
Running_Seconds | Running_Duration | Sum |
Fault_Seconds | Fault_Duration | Sum |
Optional: Add fields to convert seconds to minutes:
| Field | Formula |
|---|---|
Stopped_Minutes | [Stopped_Seconds] / 60 |
Running_Minutes | [Running_Seconds] / 60 |
Fault_Minutes | [Fault_Seconds] / 60 |
Step 3: Create Dashboard
Components:
- Stacked Bar Chart: Show duration by status and hour
- Time Range Filter: Select date range
- 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
| Field | Source | Formula |
|---|---|---|
Cumulative_Count | Link to Tag: Counter | - |
Net_Production | Formula | CHANGE([Cumulative_Count], 10000) |
Current_Shift | Link to Tag: System_Shift | - |
Shift_Date | Link to Tag: System_ShiftDate | - |
Trigger: Scheduled every 1 second
Explanation:
System_Shift: System tag that returns current shift nameSystem_ShiftDate: System tag that returns shift date (handles overnight shifts)
Step 2: Create Aggregation Table
Table: Production_By_Shift
| Field | Source Field | Processing |
|---|---|---|
Shift_Date | Shift_Date | Group by Day |
Shift | Current_Shift | Group by Same Value |
Total_Parts | Net_Production | Sum |
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:
- Table: Show production by shift and date
- Time Range Filter: Select date range (filter by
Shift_Date) - 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)
| Field | Source Field | Formula | Processing |
|---|---|---|---|
Alarm_Date | Trigger Time | - | Group by Day |
Alarm_Hour | - | HOUR([Trigger Time]) | - |
Shift | - | IF([Alarm_Hour] < 14, "Day Shift", "Night Shift") | Group by Same Value |
Alarm_Count | Alarm 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
- Use CHANGE() for Counters: Automatically handles counter resets
- Record at Appropriate Frequency: Every second for fast processes, every minute for slow processes
- Include Shift Information: Use system tags
System_ShiftandSystem_ShiftDate
Aggregation Strategy
- Multi-Level Aggregation: Raw → Minute → Hour → Day → Month
- Scheduled Triggers for Overnight Shifts: Use daily scheduled triggers instead of real-time
- Group by Time First: Group by time dimension before grouping by category
Formula Techniques
- Status Duration: Use
IF([Status] == X, 1, 0)then sum - Shift Determination: Use
HOUR()andMINUTE()functions withIF()logic - Counter Reset Handling: Use
CHANGE()function with range parameter
Dashboard Design
- Time Range Filters: Always provide date range selection
- Multiple Views: Offer hourly, daily, and shift views
- KPI Cards: Show key metrics at a glance
- Stacked Charts: Use for comparing categories over time
Next Steps
- Understanding Data Management - Review core concepts
- Creating Data Tables - Create your own tables
- Configuring Triggers and Formulas - Set up data collection
- Data Management Reference - Complete function library