*Configure Data Logging

You can log any Tag or DirectOPC item value from OPC Systems.NET to CSV files and the database engines SQL Server, Oracle, Access, and mySQL.

View the following 2 minute video for a quick tutorial on data logging.

https://www.opcsystems.com/opc_database_netfast_video.htm

View the following 13 minute video for a more detailed presentation for data logging.

https://www.opcsystems.com/opc_database_netquick_video.htm

For updating existing records with a dynamic update method view the following video.

https://www.opcsystems.com/updatelog_video.htm

For a complete list of all Data Logging properties refer to the OPC Systems Configuration-Data Logging section in this help file.

Step

Task

1

Start Configure OPC Systems application if it is not already running.

2

Select Configure-Data Logging.

3

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

4

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

5

Check Logging Active in the Common Properties Tab.

We use the default logging type of Continuous at a 1 second rate.

Event Driven Logging will log one record each time the Event Tag transitions.

Specific Time of Day will log one record at the time specified each day.

Data Change Row will log a new record anytime any of the values change by more than the deadband specified.

Data Change will log a new record for each tag that changes value.  This format is the narrow table format where which has no limit on the number of tags to log in the table, but the data is more difficult to query.

6

Select the Tags Tab.

 

7

Select the Add Field button.

8

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

 

You could also optionally use the DirectOPC selection to connect directly to OPC Items on OPC Servers by expanding DirectOPC.

9

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

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

10

Select the Database Tab.

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.

The Server name may need to be adjust 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 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.

Logging to mySQL

All steps are the same as using SQL Server except the provider should be set to mySQL.

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.

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.

 

 

 

 

 

12

Select the Add button to add the Data Logging group.

13

Select the Save button on the toolbar at the top.

14

Save the file DemoLogging.DataLog in the directory C:\OPCSystemsDemo.

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 OPC Systems application and hit the F1 key or select the ? near the property.

More:

Data Logging High Speed Data from Visual Studio Applications

Data Logging CSV Export and Import

Data Logging Programmatic Interface