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:
- Tags created in UNS
- Understanding of data retention requirements
- Database available (SQLite default or external)
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Configuration Workflow
- Configure Storage Location - Define where data is stored
- Create HistorianTables - Group tags with common settings
- Add HistorianTags - Select tags to archive
- Configure Triggers - Define when to store data
- Test Data Collection - Verify archiving and retrieval
Step 1: Configure Storage Location
Using Default SQLite Database
The platform includes SQLite by default. No configuration needed unless changing settings.
Changing Default Database
- Navigate to Historian → Storage Locations
- Click Settings icon (gear)
- Configure:
- Provider: Database type (SqlClient, PostgreSQL, etc.)
- Database: Specific database system
- Server IP: Database server address
- Click Test to verify connection
- Click OK
Adding External Historians
- Go to Historian → Storage Locations
- Click Plus icon
- Configure:
- Name: Storage identifier
- Storage System: Select "Tag Provider"
- Protocol: Choose historian (Canary, InfluxDB, PI)
- StoreAndForward: Enable for buffering
- Configure connection string
- Click OK
Step 2: Create HistorianTables
HistorianTables group tags with shared storage settings.
Creating a Table
- Navigate to Historian → HistorianTables
- Click Plus icon
- Configure properties:
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 |
- Click OK
Storage Strategies
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 |
Step 3: Add HistorianTags
Configuring Tags for Archiving
- Go to Historian → HistorianTags
- Add tags using one of these methods:
- Type tag name in first column
- Browse and select from tag list
- Copy/paste from UNS Tags
- Configure for each tag:
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 |
Example Configurations
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
Step 4: Configure Advanced Options
Normalized vs Standard Tables
Type | When to Use | Structure |
---|---|---|
Standard | Same data types | One column per tag |
Normalized | Mixed data types | Generic value columns |
Quality Tracking
Enable SaveQuality in HistorianTable to:
- Store OPC quality with values
- Show gaps in trend charts
- Identify communication issues
Store and Forward
For external historians:
- Enable StoreAndForward in Storage Location
- System buffers data during connection loss
- Automatic forward when connection restored
Step 5: Test and Monitor
Testing Data Collection
- Start Runtime:
- Press F5 or click Run Test
- Go to Historian → Monitor
- Verify Archiving:
- Check "Storage" column shows "Running"
- Monitor "Count" increasing
- Verify "Last" timestamp updates
- Test Retrieval:
- Add TrendChart to display
- Select historian tags
- Verify historical data appears
Using TrendChart
- In Displays → Draw
- Add TrendChart control
- Configure:
- Tags: Select historian tags
- Duration: Time span to display
- Navigate: Pan and zoom tools
Data Retrieval
In Displays
Use TrendChart control for visualization:
@Historian.Query(tag, startTime, endTime, interval)
In Scripts
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)
);
SQL Queries
For SQL-based storage:
sql
SELECT * FROM ProcessData
WHERE UTCTimestamp > '2024-01-01'
AND TagName = 'Tank.Level'
Common Issues
Data Not Archiving
- Verify HistorianTable is configured
- Check tag exists and updates
- Confirm trigger conditions met
- Verify storage location connection
Gaps in Data
- Check TimeDeadband settings
- Verify SaveOnChange configuration
- Review deadband values
- Enable SaveQuality for visibility
Storage Full
- Configure LifeTime for auto-deletion
- Archive old data externally
- Increase storage capacity
- Optimize storage settings
Poor Query Performance
- Create appropriate indexes
- Limit query time ranges
- Use aggregation functions
- Enable caching
Best Practices
? 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
Notes for Concept Document Enhancement
Consider adding to the Historian Concept document:
- Comparison of storage strategies (event vs. time-based)
- Data compression techniques
- Integration with external historians architecture
- Store-and-forward mechanism details
- Performance optimization guidelines
Next Steps
- [TrendChart Control →] Visualize historical data
- [Reports Module →] Create historical reports
- [Scripts Module →] Query and process historical data
In this section...
Page Tree | ||||
---|---|---|---|---|
|