Getting Started – Data Logging

Getting Started-Data Logging 15You 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.

Step 1

Getting Started-Tags 1Start Configure OAS application if it is not already running.

 

Step 2

Select Configure – Data Logging.

Getting Started-Data Logging 1

Step 3

Select the Local OAS Service by selecting the Select button or the Local node in the service tree to the left.

Getting Started-Tags 3

Getting Started-Tags 4

Step 4

Enter the Logging Group Name of Simulation in the field in the upper right.

Getting Started-Data Logging 3Getting Started-Data Logging 2

Check Logging Active in the Common Properties Tab.

Getting Started-Data Logging 3

Step 5

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.

Step 6

Select the Tags Tab.

Modify Tag 1

Step 7

Select the Add Field button.

Getting Started-Data Logging 4

Step 8

Select the Tag Parameter browse button to select the Tag Parameter Ramp.Value.

Getting Started-Data Logging 5

Getting Started-Data Logging 6

Getting Started-Data Logging 7

Step 9

Repeat steps 7 and 8 for the Tag Parameter Random.Value.

Repeat steps 7 and 8 for the Tag Parameter Sine.Value.

Getting Started-Data Logging 8

Step 10

Select the Database Tab.

Getting Started-Data Logging 15

Step 11

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.

Getting Started-Data Logging 9

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.

Getting Started-Data Logging 10

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:

https://www.openautomationsoftware.com/knowledge-base/windows-azure-setup/

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.

Getting Started-Data Logging 11

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.

Getting Started-Data Logging 12

Step 12

Select the Add button to add the Data Logging group.

Getting Started-Data Logging 13

Step 13

Select the Save button on the toolbar at the top.

Getting Started-Tags 19

Step 14

Save the file DemoLogging.DataLog in the directory OPCSystemsDemo.

Getting Started-Data Logging 14

Step 15

Go to Configure-Options and set the default Data Logging Configuration file to the file you just saved.

Step 16

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.