This guide walks you through configuring the Historian module to store time-series data for historical analysis and trending. You'll create historian tables, configure tags for archiving, set up storage locations, and retrieve historical data.
Prerequisites:
The platform includes SQLite by default. No configuration needed unless changing settings.
HistorianTables group tags with shared storage settings.
Property | Description | Example |
---|---|---|
TableName | Table identifier | ProcessData |
StorageLocation | Database destination | TagHistorian |
SaveOnChange | Store when value changes | True |
TimeDeadband | Minimum interval between saves | 00:00:05 (5 seconds) |
Trigger | Condition to force storage | Tag.ProductionRun |
LifeTime | Days to retain data | 90 |
Strategy | SaveOnChange | TimeDeadband | Trigger | Use Case |
---|---|---|---|---|
High-Speed | Yes | 00:00:01 | - | Critical process variables |
Standard | Yes | 00:00:10 | - | Normal process monitoring |
Periodic | No | - | Timer.1Min | Regular snapshots |
Event-Based | No | - | Tag.BatchStart | Batch data collection |
Property | Description | When to Use |
---|---|---|
TagName | Tag to archive | Required |
HistorianTable | Target table | Required |
DeadBand | Change threshold | Prevent small variations |
Deviation | Significant change | Override time deadband |
RateOfChange | Change rate limit | Detect rapid changes |
Tank.Level → Table: ProcessData, Deadband: 0.5
Pump.Status → Table: EventData, Deadband: 0
Reactor.Temp → Table: CriticalData, Deadband: 0.1, RateOfChange: 5
Production.Batch → Table: BatchData, Trigger-based
Type | When to Use | Structure |
---|---|---|
Standard | Same data types | One column per tag |
Normalized | Mixed data types | Generic value columns |
Enable SaveQuality in HistorianTable to:
For external historians:
Use TrendChart control for visualization:
@Historian.Query(tag, startTime, endTime, interval)
Query historical data:
csharp
// Get last 24 hours of data
DataTable data = @Historian.GetData(
"Tank.Level",
DateTime.Now.AddDays(-1),
DateTime.Now,
TimeSpan.FromMinutes(1)
);
For SQL-based storage:
sql
SELECT * FROM ProcessData
WHERE UTCTimestamp > '2024-01-01'
AND TagName = 'Tank.Level'
Data Not Archiving
Gaps in Data
Storage Full
Poor Query Performance
? Plan retention strategy - Balance storage vs. analysis needs ? Use appropriate deadbands - Reduce storage without losing significant changes ? Group similar tags - Tables by update frequency and retention ? Monitor storage growth - Track database size trends ? Test retrieval performance - Verify query response times ? Document table purposes - Clear naming and descriptions ? Regular maintenance - Archive or purge old data
Consider adding to the Historian Concept document: