One Click Database

Data Logging Groups can be automatically setup by using the One Click Database feature that browses Open Automation Software Tags automatically and creates data logging groups based on the tags in a selected services. You can then modify or delete data logging groups from the configuration that you do not want.

View the following video on how to use the One Click Database Feature or follow the steps in the table below:

Step 1

OAS
Start Configure OAS application from the program group Open Automation Software.

 

 

Step 2

Select Configure – Data Logging.

Datalogging Menu

Step 3

Select the Local OAS Service by selecting the Select button or select a remote network node by entering an IP Address or Network Node Name and click on the Select button.

Network Node

Step 4

Select the One Click button in the upper menu bar.

One Click Data Logging

Step 5

In Step 1 of the One Click Database Wizard use the Tag Group Browse button to select a starting Tag Group or leave the Tag Group blank to obtain all Tags of the OAS Service defined in the Network Node and optional Live Data Node fields.

One Click Data Logging Step 1

Also specify a Group Name that will be the base group name of all of the logging groups.

Step 6

In Step 2 specify the Logging Type and other Common properties to all Logging groups.

One Click Data Logging Step 2

Step 7

In Step 3 define the names of the common database field names.

One Click Data Logging Step 3

Step 8

In Step 4 define the Database Provider, Server, Database, and base Table name to log to if logging to a database engine. You can skip this step if you plan to log only to CSV files.

One Click Data Logging Step 4

Step 9

In Step 5 define the CSV Logging Path and File Name if you wish to setup all logging groups to log to a CSV file.

One Click Data Logging Step 5

Step 10

Click the Finish button in the lower right to begin the automated setup.

Step 11

Select the Save button on the toolbar at the top.

Save Button
Step 12

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

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, MariaDB, SQLite, InfluxDB, Amazon Aurora, Amazon RDS, Google Firebase, and MySQL.

You can view the Getting Started with Data Logging Video to familiarize yourself with the following steps to setup data logging.

  • 00:00 – Introduction
  • 01:30 – Getting Started
  • 03:00 – Continuous Logging
  • 04:15 – SQL Server
  • 06:25 – Save Changes
  • 07:00 – Continuous Narrow Logging
  • 09:30 – Event Driven
  • 11:20 – Handshake Confirmation
  • 12:45 – High Speed Logging
  • 15:00 – Log to Stored Procedure
  • 15:25 – Triggers
  • 16:30 – Event Narrow Logging
  • 18:00 – Timestamps
  • 20:30 – Snapshot Logging
  • 21:45 – Specific Time of Day Logging
  • 22:50 – Data Change Row Logging
  • 25:15 – Data Change Narrow Logging
  • 26:45 – Networking
  • 31:55 – Store and Forward
  • 37:30 – Disable Store and Forward
  • 40:15 – Update Records
  • 40:50 – Dynamic Server, Database, and Table
  • 41:10 – Automatic Deletion
  • 41:40 – CSV File Logging
  • 45:30 – Programmatic Interface
  • 46:45 – CSV Export / Import
  • 48:20 – One Click Automation
  • 52:20 – Transaction Logging
  • 54:25 – System Errors
  • 56:00 – Contact Us
  • 56:50 – Read Database Data

Step 1

OAS
Start Configure OAS application if it is not already running.

Step 2

Select Configure – Data Logging.

Datalogging Menu

Step 3

Select the Local OAS Service by selecting the Select button.

Network Node

Step 4

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

Logging Group Name

Check Logging Active in the Common Properties Tab.

Logging Active

Step 5

Determine your table format and type of logging you wish to implement and set the Logging Type.

Loggint 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.

Tags Tab

Step 7

Select the Add Field button.

Add

Step 8

Select your Network Node in the Browse Tags window.  Then use the Tags Tree to select the Ramp.Value.

Value is the most commonly used Variable.  See Tag Variables for a complete list of all variables possible.

Local Tag

myGroup.myTag.Value

Basic Networking

\\192.168.0.1\myGroup.myTag.Value

Live Data Cloud Networking from local OAS Engine

RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Live Data Cloud Networking though remote OAS Engine

\\192.168.0.1\RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

The following is an example of accessing an element of an array as a read only variable.

myGroup.myTag.Value[0]

Adding Multiple Tags

To add multiple tags from a tag group select the group and click ADD ALL TAGS FROM to add all tags in one step.  Leave the group field blank located to the right of ADD ALL TAGS FROM to add all of the tags in a service.

Click OK.

Tag Browse

Confirm that you have the correct information in the Database Tag window that pops up. Click Ok.

Database Tag

Step 9

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

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

Selected Tags

Step 10

Select the Database Tab.

Database Tab

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.

SQL Server Setup

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:

/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 wish to use a name from TNSNAMES.ORA file refer to the Frequently Asked Questions in this Data Logging topic as OAS uses OracleManagedDataAccess assembly.

Logging to mySQL

All steps are the same as using SQL Server except the provider should be set to mySQL.
For maximum throughput set the following in C:\ProgramData\MySQL\MySQL Server 8.0.

max_allowed_packet=1G

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 MariaDB

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

Logging to SQLite

All steps are the same as using SQL Server except the provider should be set to SQLite and the File Path property should be set to the directory and file name for the file.

Logging to InfluxDB

All steps are the same as using SQL Server except the provider should be set to InfluxDB and you can adjust the Indexed Fields property if more than DateAndTime tag is required.

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 C:\OASLoggingDemo\ 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.

MS Access Setup

Logging to Comma Separated Variable Files

Use the following configuration for CSV text logging.

Make sure to create the directory OASLogging Demo on your C drive or specify a different Database path that will exist.

CSV Setup

Step 12

Select the Add Group button in the left pane to add the Data Logging group.

Add Group

Step 13

Select the Save button on the toolbar at the top.

Save

Step 14

Save the file DemoLogging.DataLog.

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.

Overview – Data Logging

The Data Logging product, which is also known as the Data Historian, allows you to log Tag data to databases and CSV files. Database logging supports SQL Server, Oracle, Access, MySQL, PostgreSQL, Cassandra, MongoDB, MariaDB, SQLite, InfluxDB, SQL Azure, Amazon Aurora, Amazon RDS, Amazon Redshift and Google Firebase.

Data logging can be configured in OAS using Logging Groups. A logging group is a configuration construct that defines the logging behavior, which tags should be logged, the database connection parameters and the data logging format type. You can define as many logging groups as you need.

Some of the key features include:

  • Interval, time, event or data change logging triggers
  • Configurable column names
  • Automatically creates tables
  • High precision timestamp
  • Supports dynamic host, database and table configuration based on Tag source
  • Expired data removal

Frequently Asked Questions – Tags

Can I setup Tag programmatically?
Yes, using the OPC Systems component. The most effective method to set up multiple tags in one call is the TagCSVImport method as demonstrated in the Programmatic Interface topic in .NET Configuration - Programmatic Access Tags.
Can I access a bit of an Integer value of an Open Automation Software Tag?
Yes, set the Data Type of the Open Automation Software Tag to Signed Byte, Unsigned Byte, Short Integer, Unsigned Short Integer, Integer, Unsigned Integer, Long, or Unsigned Long. When browsing for a Tag in a client application Bit00 up to Bit63 will be available selection immediately under the Value property. myTag.Bit00 is an example of providing read and write access to bit 0 of an integer value.
A CSV Export and Import does not work when running on a system with Regional Language settings use a comma as a decimal holder.
Because the OAS Service runs under the SYSTEM Account it is not using the Regional Language settings. In some operating systems when you change the Regional Language the SYSTEM account is not updated. To correct this go to Region and Language under Control Panel, and select the Administrative tab. Select Copy settings and select the option to Copy your current settings to: Welcome screen and system accounts and select OK. Restart the OAS Services or restart the operating system. The CSV export and import will now use your decimal separator selected for the operating system.
We have accumulative value and we want to take Delta for this accumulative value at end of each hour. For example value at start of the hour is 100 and at the end of the hour it is 150, so Delta is 50 for this specific hour. How we can use calculation tag option to achieve it?
First create a String Tag called DateTime with the Data Source of DateTimeString. Next create a Double Tag called InitialValue with the Data Source of Calculation and the following Calculation. IF(SUBSTR([DateTime.Value],STRLEN([DateTime.Value])-5,5) = “00:00”,[SourceTag.Value],[InitialValue.Value]) Then you have a second Double Calculation Tag called TheDifference with the following Calculation. [SourceTag.Value]-[InitialValue.Value] A third Calculation Tag called LastHour can be used to hold the last hour’s result. IF(SUBSTR([DateTime.Value],STRLEN([DateTime.Value])-5,5) = “59:59”,[TheDifference.Value],[LastHour.Value])
I want to create a Calculation that gives a result of a sum over 15 minutes and then resets to 0.
Create a Calculation Tag with the following Calculation. AVG(IF(MOD([SumCalcs.TotalSeconds.Value],900)=0,-987654321,[SumCalcs.Input.Value]),900)*MOD([SumCalcs.TotalSeconds.Value],900)
How to display hours, minutes, and seconds as a string from Time On of a Tag.
STRFORMAT([myTagValueTimeOnTotal]%60,"00")&":"&STRFORMAT(MOD([myTagValueTimeOnTotal],60),"00")&":"&STRFORMAT(([myTagValueTimeOnTotal] - ([myTagValueTimeOnTotal]%60)*60 - MOD([myTagValueTimeOnTotal],60))*60,"00")
I want to have a bit go to true at 7, 15, and 23 hours.
  1. Create a Tag called DateAndTime with the Date Type of String and the Data Source of DateTimeString.
  2. Modify the Calculation in both Reset tags to the following.
IF(SUBSTR([DateAndTime.Value],STRLEN([DateAndTime.Value])-8,8) = ""07:00:00"",1,0)|IF(SUBSTR([DateAndTime.Value],STRLEN([DateAndTime.Value])-8,8) = ""15:00:00"",1,0)|IF(SUBSTR([DateAndTime.Value],STRLEN([DateAndTime.Value])-8,8) = ""23:00:00"",1,0)
How can I keep track of how long a Boolean Tag is on or how many times it has transitioned?
Use the Time On and Counts property.
Tag CSV Export and Import

Import CSV

Select the OAS Service that you desire to import a CSV file to the Tag configuration and click the CSV Import button on the top menu to import a Comma Separated Variable file.
CSV Import
Use the Export CSV feature to generate a CSV file. You can then use Microsoft Excel or other CSV compatible application to add or modify Tags. Only the Tag name is the required field. You can select to include or exclude all other fields. Only those fields that are found in the header will be used to update the properties of the Tags. If a Tag already exists it will be updated. If the Tag does not exist it will be created. Existing Tags that are not specified in the CSV file will not be updated or deleted. The same tag parameter structure can be used to programmatically define tags with the TagCSVImport method on the free to use OASConfig and OPCSystems components. This is demonstrated in  .NET Server Configuration-CSV Import and Export example.

Export CSV

Select the OAS Service that you desire to extract the Tag configuration from and select click the CSV Export button to generate a Comma Separated Variable file.
CSV Export
You can then use Microsoft Excel or other CSV compatible application to add or modify Tags. Use the Import CSV feature to then import the modified CSV file.
If you wish to just export a particular Tag Group, right click on the Tag Group and select Export to CSV.
Export to CSV

Videos – Tags

Getting Started Tags

For a quick tutorial on configuring tags view the Quick Start Example – Configure Tags section or view the following video:

Getting Started OAS (Legacy)

The following video was created from earlier versions of OAS, but is still applicable for those data sources shown in the video to familiarize yourself with installation, setting up Tags, selecting Data Sources and Destinations, and implementing Networking and Security.

One Click OPC

Automatically setup the realtime database from OPC Servers in one step.

One Click Allen Bradley

How to automatically import Allen Bradley variables to Open Automation Software.

OPC Servers

How to connect to OPC Servers for all products.  Refer to One Click OPC for automated setup.

OPC Server to OPC Server

How to setup automatic data transfer from OPC Server to OPC Server on your LAN, WAN, and Internet.

Calculations

How to setup math equations and logic as a Data Source with the built Calculation engine for all products.

Alarm Limits

How to setup alarm limits in real-time tag configuration.

  • 00:00 – How to set up alarms limits
  • 00:24 – Programmatically Configure Tags
  • 01:34 – Another way to adjust the alarm limit
  • 02:17 – Alarms Group
  • 02:52 – Alarm Priority
  • 03:07 – Time Delay
  • 03:18 – Alarm Text
  • 04:55 – Alarm Tracking
  • 05:29 – Alarms Limits
  • 06:26 – Boolean Signals
  • 06:34 – Example Applications Videos
  • 07:07 – More Questions

Time On and Counts

Monitor how many times a value or alarm transitions and how long it has been active.

Total

Summation for total values.

Watch Window

View multiple tag values, timestamps, and data quality using the Watch Window.

 

Tag CSV Export and Import

Import CSV

Select the OAS Service that you desire to import a CSV file to the Tag configuration and click the CSV Import button on the top menu to import a Comma Separated Variable file.

CSV Import

Use the Export CSV feature to generate a CSV file. You can then use Microsoft Excel or other CSV compatible application to add or modify Tags. Only the Tag name is the required field.

You can select to include or exclude all other fields. Only those fields that are found in the header will be used to update the properties of the Tags. If a Tag already exists it will be updated. If the Tag does not exist it will be created. Existing Tags that are not specified in the CSV file will not be updated or deleted.

The same tag parameter structure can be used to programmatically define tags with the TagCSVImport method on the free to use OASConfig and OPCSystems components. This is demonstrated in  .NET Server Configuration-CSV Import and Export example.

Export CSV

Select the OAS Service that you desire to extract the Tag configuration from and select click the CSV Export button to generate a Comma Separated Variable file.

CSV Export

You can then use Microsoft Excel or other CSV compatible application to add or modify Tags. Use the Import CSV feature to then import the modified CSV file.

If you wish to just export a particular Tag Group, right click on the Tag Group and select Export to CSV.

Export to CSV

Time On and Counts

View the following video for explanation of each parameter and how to enable Time On And Counts:

When this feature is enabled in a Tag Value or Alarm Limit it will keep track of how long a Boolean value is true and how many times it transitions to True.

The Time On and Counts feature will keep track of the following:

  • TimeOn – How long the point is on for the current instance in minutes.
  • TimeOnCurrentDay – How long the point is on for the current day.
  • TimeOnPeriod1 – How long the point is on for Period 1.
  • TimeOnPeriod2 – How long the point is on for Period 2.
  • TimeOnTotal – How long the point has been on for all of time.
  • CountCurrentDay – How many times the point has transitioned for the current day.
  • CountPeriod1 – How many times the point has transitioned for Period 1.
  • CountPeriod2 – How many times the point has transitioned for Period 2.
  • CountTotal – How many times the point has transitioned for all of time.

The following image shows how the points will appear for connection in a client if the High High Alarm Limit is enabled for Time On and Counts.  You can also use Value or any other Alarm Limit.

Time On and Count Parameters

Daily Reset

The time of day that the day should end to reset the Time On and Counts.

Period 1

The amount of time in minutes to keep track of for Time On and Counts for Period 1 time.

Period 2

The amount of time in minutes to keep track of for Time On and Counts for Period 2 time.

Reset Time On and Counts Tag

When defined to a Boolean tag the Time On and Counts totals will be reset with the tag is True.

Retain Time On and Counts on Service Restart

To retain the Time On and Counts totals after a system restart go to Configure-Options-Retain Values and enable to retain Time On and Counts to a file.

Alarm Limits

Each tag can have adjustable or fixed alarm limits for High High, High, Low, Low Low, Rate of Change, or Digital alarms.

The video below is a 7 minute explanation of setting up Alarm Limits:

  • 00:00 – How to set up alarms limits
  • 00:24 – Programmatically Configure Tags
  • 01:34 – Another way to adjust the alarm limit
  • 02:17 – Alarms Group
  • 02:52 – Alarm Priority
  • 03:07 – Time Delay
  • 03:18 – Alarm Text
  • 04:55 – Alarm Tracking
  • 05:29 – Alarms Limits
  • 06:26 – Boolean Signals
  • 06:34 – Example Applications Videos
  • 07:07 – More Questions

Enable Alarm

To enable an Alarm Limit for a tag, check the Enable Alarm box at the top of the properties window. To enable an Alarm Limit with a tag, check the Enable with Tag.. box instead. Then use the Browse button that appears to select the tag you wish to use to enable the alarm.

Alarm Limit Source

Use the Alarm Limit Source drop down to specify the source of the alarm limit. If value is selected, enter a numeric value in the High High Limit box below. Other options include another tag or a calculation. Setting a Deadband for the alarm limit specifies an amount that the value must be within the limit before the alarm condition is cleared. When the tag value goes above the Out of Range value the alarm limit is not evaluated and the alarm is disabled.

Disabling an Alarm

Checking the Date Disable… box brings up Start and End fields; use these to disable an alarm for a date/time range. Checking the Daily Disable… box brings up hour and seconds fields; use these to disable an alarm for a certain time period each day.

Alarm Text

Use the Alarm Text box to enter the text that will be displayed in alarm notifications, on and HMI screens and recorded in alarm logging. There are five ways to set the alarm text using the Alarm Text Type dropdown.

  1. Static Alarm Text: displays the Alarm Text as is.
  2. Preset Alarm Text: brings up a Browse button to select a Dynamic Text Tag whose value will prepend the Alarm Text.
  3. Overwrite Alarm Text: brings up a Browse button to select a Dynamic Text Tag whose value will overwrite the Alarm Text.
  4. Append Alarm Text: brings up a Browse button to select a Dynamic Text Tag whose value will be appended to the Alarm Text.
  5. Calculation: allows you to create a Calculation using the Edit button to produce the Alarm Text.

Alarm Groups and Priority

Use the Group dropdown to select a an existing group to categorize an Alarm. You can also create a new group by typing into the Group dropdown. Once you have Applied Changes to the tag, the new group will be available for other alarms. Groups are used for filtering alarms for notifications, alarm logging and HMI. You can also enter a numeric Priority for each alarm. The valid range is from 0 to 2,147,483,647. This is another way to filter and organize alarms.

Other Alarm Properties

Time Delay: The Time Delay in seconds that the alarm condition must remain active before the alarm is posted as an active alarm. The date and time when the alarm first became active is used as the alarm date and time, not the date and time it was posted as an active alarm. If you would Like the AlarmStatus parameter To be Set immediate And Not wait For the Time Delay use Configure-Options To Set Update Alarm Status Immediately without Alarm Time Delay.

Log as Event: Enabling this will have record the alarm as a single event when the alarm limit is reached. It will not have an acknowledged state.

Document: Use this to associate a document with the alarm. It could be displayed for an operator in an HMI screen.

Trend Point: Check this to make the alarm limit available for trending.

Source When Bad: Allows the value and data quality to be overridden when the value quality is bad.

  1. Normal Bad Quality: When the data source is bad quality the result is bad quality. With Calculations any one of the source tags in the calculation being bad quality will cause the result to be bad quality.
  2. Set Sources To Default Value: When the data source quality is bad the source value is overridden to be what is set as Default Value with the data type of Default Value Type.
  3. Hold Sources To Last Good Value:  When the data sources quality changes to bad quality the last good value will be used as the data source. 
  4. Set Sources To Tag Value: When the data sources quality is bad the value from another Open Automation Software Tag will be used.

Enable Time on and Counts: See the Knowledge Base article, Time On and Counts, for more information.

Save and Load Tags

Save Tags

Save Button

If modifications are made to the current Tag configuration for the Service, make sure to save the changes if you want the changes to be retentive when the Service restarts.

Use Configure – Options to specify the default Tag configuration to load on the start of the Service.

Load Tags

Load Button

Use this selection to load a previously stored Tag configuration. This option is not available is the Service is in Runtime mode.

Use Configure – Options to set the default Tag configuration to load when the Service first starts.