How to Capture Real-Time OPC DA and OPC UA Data for Archiving
Capturing real-time OPC data for long-term storage requires a middleware layer that subscribes to both OPC DA and OPC UA servers simultaneously and writes incoming values to a persistent destination such as a SQL database, CSV file, or cloud platform. OPC Expert handles this end-to-end: you select your OPC items, right-click to create an archive, choose your destination, and the software begins writing data immediately. No custom scripting or additional OPC client applications are required.
How OPC Expert Reads from OPC DA and OPC UA Simultaneously
OPC Expert includes both an OPC DA client and an OPC UA client in its core architecture. When you browse an OPC server and subscribe to items, OPC Expert begins receiving data change notifications as values update on the controller. Items from OPC DA and OPC UA servers can be archived together in a single session, with each item’s source clearly identified by its quality code. OPC DA items carry the classic quality value of 192 when good, while OPC UA items use a quality of zero for a good status. Both are written to the same archive destination, making it straightforward to query data from mixed-protocol environments.
Event-Based Capture vs. Time-Based Capture
OPC Expert gives you a choice between event-based and time-based archiving. Event-based capture writes a record to the database only when a value changes. This dramatically reduces storage requirements for slow-moving process variables that hold a constant value for long periods. Time-based capture writes a record at a fixed interval regardless of whether the value has changed, which is appropriate when a complete time-series record is required for regulatory or audit purposes. Both options are configurable per archive job, so you can mix strategies across different tag groups depending on operational requirements.
Preventing Data Loss with Store-and-Forward
A common concern in any archiving setup is what happens when the destination database or network connection is temporarily unavailable. OPC Expert addresses this with a built-in store-and-forward mechanism. When the connection to SQL, Azure, or any other destination is lost, OPC Expert continues to store incoming data locally. Once the connection is restored, all buffered records are forwarded in sequence, so the archived dataset remains complete. This behavior is automatic and requires no additional configuration.
Running as a Windows Service
For unattended, continuous operation, OPC Expert can be installed as a Windows service. Once configured as a service, it starts automatically when the machine boots, resumes archiving after a reboot or Windows update, and requires no user login to remain active. The GUI application is separate from the service layer, meaning the archiving process continues even if the interface is closed. This separation is important in production environments where the archive server must run reliably overnight or across weekends without operator intervention.
Relevant Tools
Archive OPC Data is the OPC Expert module that handles real-time and historical data capture from OPC DA, OPC UA, and MQTT sources. It supports storage to Microsoft SQL, MySQL, SQLite, CSV, XML, Microsoft Azure, Amazon AWS, and MongoDB. OPC Viewer is the OPC Expert module used to browse available OPC servers, subscribe to items, and initiate the archive setup through a right-click action on any selected items.
Conclusion
Capturing real-time OPC DA and OPC UA data for archiving is a straightforward process in OPC Expert. You subscribe to your items using the built-in OPC client, choose a storage destination, select event-based or time-based capture, and the software manages the rest, including automatic reconnection, local buffering, and store-and-forward delivery. The result is a complete, timestamped archive that does not require a traditional data historian to implement.