If you’re an existing user of OPC Data Logger or in the market for an OPC logging solution, you likely agree that having a reliable and accurate record of your data is a top priority. One of the most valuable parts of investing in a data logging solution is being able to trust that all the data from your sources is captured. But what happens if you lose the connection to your database? What happens to the incoming data during that downtime? Software Toolbox offers several solutions for logging data and today we will focus on OPC Data Logger and its database logging capabilities.
In this blog post, we will cover how the new Store and Forward capabilities of OPC Data Logger work to help you ensure you don't lose data if a database storage location is unavailable, and provide a brief walkthrough of configuring this for your database connections.
If using OPC Data Logger to log data to a database is new to you, we highly recommend our video resource library: OPC Data Logger Training and Tutorial Videos
What is Store and Forward?
Optimized in V4, the Store and Forward feature in OPC Data Logger is an optional setting that is enabled by default, which allows the creation of a local storage buffer file on the machine when the connection to your database is unavailable. This feature acts as a safeguard against potential data loss during outages, caused by things such as network failures, database maintenance, or unexpected system shutdowns.
Once the connection to the database is re-established, the OPC Data Logger will start transmitting the stored data from the local file to the database. The data will be transmitted in the order in which it was received according to timestamps, ensuring a complete and accurate data record that appears free of interruptions.
How Does it Work?
Whether you are creating a new database logging project, or modifying an existing one, the Store and Forward features can easily be modified from the OPC Data Logger options.
Navigate to the Tools tab in the top banner of the application to access the Options:
Accessing the Options menu will provide a list of configurable properties. There are three properties related to Store and Forward capabilities:
- Database Store and Forward – When True, users allow the OPC Data Logger to locally save logged values to the hard drive if connection to the Data Storage is lost. Once the Data Logger reconnects to the database, the locally logged values are inserted into the database before resuming normal logging.
- Store and Forward File Path – The location on the disk allocated for storage when Store and Forward is enabled. The default file path is C:\ProgramData\Software Toolbox\OPC Datalogger\Buffer
- Store and Forward Log Rate (Sec) – The rate at which Store and Forward notifications will be displayed in the OPC Data Logger Event Log, when active. The default value is 30 seconds.
Store and Forward in Action
Below I have created a simple OPC Data Logger project connected to a TOP Server instance via OPC UA to log data seamlessly from a simulated device. This is connected to a local SQL Server using the native driver provided by OPC Data Logger, although this will work with any of OPC Data Logger’s database storage options.
Once configured with the runtime started, data is logged continuously into the new table at a rate of 5-seconds:
To simulate a database connection loss, I have disabled the SQL Server instance. The Event Logger reports when the buffer starts being pushed to the local file. It will also display the number of records and current size of the temporary file based on the Store and Forward Log Rate.
Once the SQL Server instance is enabled again, OPC Data Logger automatically reconnects to the database and the stored values are forwarded to the table. Upon completion of the forward, the local file is closed and removed from the system.
Below, we can verify that all items are recovered and pushed successfully in sequence. Between the start of the local buffer at 09:50.28 and the reconnection of the Database at 09:51.33 there is a consistent record of data. This ensures a transparent record of your data collection is maintained and no loss of connection is detectable!
Today we've shown you how to use OPC Data Logger's Store and Forward capabilities for database storage connections to ensure the data gets to its destination. There are many other reasons to consider OPC Data Logger, such as its ability to log data based on triggers of many types, including PLC/controller data point triggers, and also its ability to confirm the logging back to the device when done.
Whatever your data logging requirements are, we encourage you to reach out to us using chat or contact us here. If OPC Data Logger isn't the right solution, then perhaps one of our other solutions will be. Let's talk about your challenges.