Getting Started – Data Logging
You can log any Tag or DirectOPC item value from Open Automation Software to CSV files and the database engines SQL Server, Oracle, Access, PostgreSQL, Cassandra, MongoDB, and MySQL.
Start Configure OAS application if it is not already running.
Select Configure – Data Logging.
Select the Local OAS Service by selecting the Select button or the Local node in the service tree to the left.
Enter the Logging Group Name of Simulation in the field in the upper right.
Check Logging Active in the Common Properties Tab.
Determine your table format and type of logging you wish to implement and set the Logging Type.
- Continuous: Log data in a wide table format at a specific rate.
- Continuous Narrow: Log data in a narrow table format at a specific rate.
- Event Driven: Log data in a wide table format when a Boolean or Integer Tag changes.
- Snapshot: Log cached data in a wide table format when a Boolean Tag changes. The cached data is collected prior to the event and only logged when the event occurs.
- Specific Time Of Day: Log data in a wide table format at a specific time of day.
- Data Change Row: Log data in a wide table format when any of the tag values change.
- Data Change Narrow: Log data in a narrow table format when the tag value changes.
- Merlin: Not applicable, only used for one of our OEM customers.
Wide Table Format: Specify a specific column to map the tags to log to.
Narrow Table Format: Log all tag values into 3 fields, Tag Name, Value, and Timetamp. This type is more difficult to query directly and is not supported by trend history.
We use the default Logging Type of Continuous at a 1 second rate in this example.
Select the Tags Tab.
Select the Add Field button.
Select the Tag Parameter browse button to select the Tag Parameter Ramp.Value.
Repeat steps 7 and 8 for the Tag Parameter Random.Value.
Repeat steps 7 and 8 for the Tag Parameter Sine.Value.
Select the Database Tab.
Logging to SQL Server or SQL Server Express
Use the following configuration for SQL Server and SQL Server Express. The Database and Table will automatically be created for you.
The Server name may need to be adjusted from localhost to the proper Server name of the SQL Server engine you wish to log to. This Server name can be found when first bringing up the Connect dialog of the SQL Server Management Studio.
Also the login method can be with Windows Authentication or SQL Server mode. Contact your database administrator if you are unsure of what login type to use.
You can download a free version of SQL Server Express from www.microsoft.com.
Logging to Microsoft Azure
Use the SQL Server Provider and view the following guide to setup Microsoft Azure:
Logging to Oracle
If you are using Oracle you must first create the database. All other steps are the same as SQL Server except the provider should be set to Oracle. Oracle does not create the database so you will have create the database manually.
If you do not have a TNSNAMES.ORA file or need to log to a remote database engine refer to the Frequently Asked Questions in this Data Logging topic.
Logging to mySQL
All steps are the same as using SQL Server except the provider should be set to mySQL.
Logging to MongoDB
All steps are the same as using SQL Server except the provider should be set to MongoDB.
Logging to PostgreSQL
All steps are the same as using SQL Server except the provider should be set to PostgresSQL.
Logging to Cassandra
All steps are the same as using SQL Server except the provider should be set to Cassandra.
Logging to Microsoft Access
If you prefer to use Microsoft Access instead of SQL Server use the following configuration for Microsoft Access. The Database and Table will be automatically created for you. Make sure to create the directory OPCSystemsDemo on your C drive or specify a different Database path that will exist. When logging to MS Access 2007 or later use the extension .acccdb. Versions older than 2007 use the classic .mdb extension. This will switch the OAS data logging engine to use the correct provider.
Logging to Comma Separated Variable Files
Use the following configuration for CSV text logging.
Make sure to create the directory OPCSystemsDemo on your C drive or specify a different Database path that will exist.
Select the Add button to add the Data Logging group.
Select the Save button on the toolbar at the top.
Save the file DemoLogging.DataLog in the directory OPCSystemsDemo.
Go to Configure-Options and set the default Data Logging Configuration file to the file you just saved.
Important: Enable Data Buffer To Disk under Configure-Options-Data Buffering on all data source Tag servers and data logging servers to retain data on a network failure or database engine failure.
After completing the above steps you can view the data in your database or CSV file.
For more detailed information on each data logging parameter view the Data Logging section in this help file or simply select the property in the Configure OAS application and hit the F1 key or select the ? near the property.