Skip to main content

History Read

This section covers how to use the OPC UA History Read node to retrieve historical data from OPC UA servers.

Overview​

The OPC UA History Read node enables you to:

  • Read raw historical values stored on the server
  • Retrieve aggregated data (averages, maximums, minimums, etc.)
  • Access modified historical values
  • Query data using flexible time specifications
  • Process multiple variables efficiently

Historical data is essential for:

  • Trend analysis and reporting
  • Performance monitoring
  • Quality control and auditing
  • Predictive maintenance
  • Compliance and documentation

Tutorials​

Getting Started​

Working with Time​

Advanced Topics​

Quick Reference​

Read Last Hour (Raw Data)​

msg.nodeId = "ns=2;s=Temperature";
msg.startTime = "1 hour ago";
msg.endTime = "now";

Read Daily Averages​

msg.nodeId = "ns=2;s=Temperature";
msg.startTime = "7 days ago";
msg.endTime = "now";
msg.processingInterval = "1 day";
// Set node to: Processed Details, Aggregate: Average

Read Specific Date Range​

msg.nodeId = "ns=2;s=Pressure";
msg.startTime = "2024-11-20T08:00:00Z";
msg.endTime = "2024-11-20T17:00:00Z";

Common Use Cases​

  • Trend Analysis: Read hourly/daily aggregates for long-term trends
  • Reporting: Extract data for specific periods (shifts, days, months)
  • Dashboards: Display recent history with real-time updates
  • Quality Monitoring: Track process variables over time
  • Compliance: Generate audit reports from historical records
  • Troubleshooting: Investigate what happened during incidents

See Also​