Getting Started – Recipe

View the following video for a step by step tutorial on setting up recipe executions:

Recipes are used to transfer values from a database to Open Automation Software Tags. If the Tags Data Source is set device data or IoT Cloud systems the values will also be written to the source the Tag is defined to. The most common implementation is to have a variable in a PLC trigger the recipe execution.

The PLC will then wait for either the Confirmation or Error Code to be written to the PLC to indicate if the recipe execution has completed. If in Error the PLC can then retry the Trigger.

Follow the steps listed below or view the video on defining recipes.

For a complete list of all Recipe properties refer to the Recipe Properties section in this help file.

Step 1

OASStart Configure OAS application if it is not already running.

Step 2

Select Configure Tags to add some Tags to use with the Recipe execution.

Configure Tags

Step 3

Select the Local OAS Service by selecting the Select button next to the Network Node dropdown.

Network Node

Step 4

If you are working on an existing Tag configuration you want to keep save it now.

Right Click on the Tags Group at the root level of the Tag Tree and select Delete All to clear all Tags.

Delete All

Step 5

Add the following Tags with the specific Data Types:

Trigger as a Boolean

Value01 as an Integer

Value02 as an Integer

Lot as a String with the Value A

Confirmation as a Boolean

Error Code as an Integer

Query String as a String with Data Source of Calculation
“WHERE Lot = ” & “‘” & [Lot.Value] & “‘”

Step 6

Select the Save button on the toolbar at the top and use the file name Recipe Tags.

Save Button

Step 7

Use Microsoft SQL Server, Oracle, Access, mySQL, PostgreSQL, Cassandra, or MongoDB to create the following Table.

Create a Database called OASDemoRecipes

Create a Table called RecipeValues with the following structure.

Recipe

Enter the following values to the Table RecipeValues.

Recipe

Step 8

With the Configure OAS application select Configure-Recipes.

Configure Recipes

Step 9

Select the Local OAS Service by selecting the Select button next to the Network Node dropdown.

Network Node

Step 10

Enter the Recipe Name Recipe 01.

Recipe Name

Set the Recipe Active.  You also have he option to Activate the Recipe with a Tag.  For this tutorial just check the Recipe Active box.

Recipe Active

Set the Recipe Type to Wide Table.

Recipe Type

  • A Wide Table type allows you to map the database fields to read to the OAS tags in the Tags tab of the recipe group.
  • A Queued Wide Table type performs the same as Wide Table type and will delete the top record if the recipe execution is successful.
  • A Narrow Table has only 2 fields, one for the Tag Name to set and one for the Value to write to the Tag.  Using this type you can define the Tags to write to in the database table along with the values.
  • A Queue Narrow Table type performs the same as Narrow Table type and will delete the records obtained if the recipe execution is successful.

Set the Tag to Execute Recipe as Trigger.Value.

Enable Confirmation Tag as Confirmation.Value.

Enable Error Tag as Error Code.Value.

Recipe Properties

When a recipe is executed it will only write to Tags where the desired value from the database is different than the current value of the Tag.  For floating point values use the Float Deadband property under the Common tab to define what is the allowable range to determine if a value is the same or different.

The Timeout property is the amount of time the recipe execution will wait for all values to be returned from the Tags.  If one or more of the values does not read back from the data source the recipe execution will end with an Error Code of Timeout.

The property Write All Values Without Feedback will not wait for the values to be returned and will write all database values to all defined Tags.  This is preferred for a faster execution when using the Execution Type Continuous.

Step 11

Select the Tags Tab

Tags Tab

With the Tags properties you can assign the database table fields to Open Automation Software Tags to write to when the recipe executes.

All OAS Tag Variables that are write capable including configuration parameters can be updated.

If the Data Source of the Open Automation Software Tag is defined to a device or IoT cloud server a write to the Value variable will it will automatically write the database value to the source.

Select the Add Field button.

Add Tags

Select the Tag and Parameter Value01.Value.

Change the Field Name to Value01.

Change the Data Type to Integer.

Recipe Value01

Select OK.

Select the Add Field button.

Add Tags

Select the Tag and Parameter Value02.Value.

Change the Field Name to Value02.

Change the Data Type to Integer.

Recipe Value02

Select OK.

Aggregate SQL Functions

You can use aggregate functions MIN, MAX, AVG, SUM, COUNT, STDEV, STDEVP, VAR, VARP, COUNT_BIG, GROUPING, GROUPING_ID, and CHECKSUM_AGG.
Set the Field Name to the function with the table field. Example = MIN(FieldName)

Dynamic Tag Aliasing

Dynamic Tag Name Aliasing is possible with one or more of the 3 alias types. This is typically used with queries that will return multiple rows, but can used also with just a single row returned.
The alias definition is encapsulated with # and is replaced entirely with the value for the database, zero based row number, or field name.

DB-Value: Changes the Tag Name based on the field value returned for the column name and data type specified.
#DB-Value:FieldName:DBType:TextFormat#
DBType = Integer, Double, Boolean, Date/Time, Single, Long, Short, SByte, String, NChar, Varchar, or NVarchar
TextFormat is optional and is used to convert the native value from the database to a text string
Example = #DB-Value:FieldName:Integer:0000#

DB-Row: Changes the Tag Name based on the zero row number returned from the query.
#DB-Row:TextFormat#
Example = #DB-Row:0000#

DB-Field: Changes the Tag Name based on the field name defined.
#DB-Field#

TAG-Value: Changes the Tag Name based on the tag value of a local tag. Please note this feature does not currently support remote network tags.
#TAG-Value:TagName.Variable:TextFormat#
TextFormat is optional and is used to format the conversion the native tag value to a text string
Example = #TAG-Value:TagName.Value:0000#

Full example using dynamic tag aliasing: #DB-FIELD#Row#DB-ROW:0000#id#DB-VALUE:id:Integer:0000#.Value
The tag name will be changed to Value1Row0000#id1234.Value for row 0 if the field name is Value1, and the value of Integer id column is 1234
The tag name will be changed to Value1Row0001#id5678.Value for row 1 if the field name is Value1, and the value of Integer id column is 5678

Stored Procedures

When obtaining values from Stored Procedure set the Field Name to the Stored Procedure Return Name.

Step 12

Select the Database Tab.

Database Tab

Define the proper database connection.

Enable the property Set Query String with Tag and set to Query String.Value.

Recipe Database Configuration

Note: A View can be used in replace of the Table.

Step 13

Select the Add button in the lower left to add the Recipe.

Add Recipe

Step 14

Select the Save button on the toolbar at the top.

Save

Save the file RecipeExample.Recipes in the directory OASDemo.

Go to Configure-Options and select the Default Files tab and set the default Recipe Configuration file to the file you just saved.

To track details of recipe execution go to Configure-Options and select the System Logging tab to enable Log Recipe Transactions and specify where the recipe transactions will be save.

Step 15

At this point you are ready to execute the recipe which you can do with Configure-Tags to set the Lot to A, B, or C, then set the Trigger Value from False to True.

You can then see that the Confirmation Tag will be set to True and Value01 and Value02 update if the Recipe is successful or the Error Code Tag will be a positive number if there is an error. Review the Recipe Transaction Log for details of the transaction.

Getting Started – Alarm Notification

The Alarm Notification feature is used to summarize alarm totals and send e-mails based on specified filter criteria of alarm conditions.

In order to utilize alarm notification you must first define the Tag Alarm Limits as described in Configure Tags of this Quick Start section.  For a complete list of all Alarm Notification properties refer to the OAS Configuration – Alarm Notification section in this help file.

Step 1

OASStart Configure OAS application.

 

 

Load the DemoTags Tag configuration or use the new Tag configuration you have created.

Step 2

Select Configure-Alarm Notification.

Configure Alarm Notification

Step 3

Select the Local OAS Service by selecting the Select button next to the Network Node drop down.

Network Node

Step 4

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

Notification Group Name

Step 5

Check Notification Active in the Common Properties Tab.

Notification Active

Step 6

Select the Filters Tab.

Filters Tab

Notice how you can define filtering based on Alarm Priority, Alarm Groups, and Alarm Types.

Filters

Step 7

Select the notification type your would like to set up – Email, SMS or Voice. To use SMS or Voice as a notification type you will need to use the Twilio service.

7.1 For Email notifications select the Email tab

Email Tab

You can define to send alarms that meet the filter criteria to an e-mail account. Use a semicolon to separate multiple e-mail addresses.

Alarm Notification Email

 

7.2 For SMS notifications select the SMS tab

SMS Tab

To trial the functionality you can use the demo mode to send 10 notifications. To use SMS as a notification type you will need to use the Twilio service.

Alarm Notification SMS

7.3 For Voice notifications select the Voice tab

Voice Tab

To trial the functionality you can use the demo mode to send 10 notifications. To use Voice as a notification type you will need to use the Twilio service.

Alarm Notification Voice

Step 8

Select the Tags Tab

Tags Tab

With the Tags properties you can assign to automatically write alarm statistics to Open Automation Software Tags. Useful to drive an external alarm horn through a PLC or display how many alarms are currently active.

Alarm Notification Tags

 

Step 9

Select Configure-Tags and add a Boolean Tag with the name Alarm Is Active.

Add an Integer Tag with the name Number Of Alarms Active.

Add an Integer Tag with the name Number Of Alarms In Last 24 Hours.

Step 10

Return to Configure-Alarm Notification:

  • Enable the property to Set Tag When Alarm Active
    Assign the Tag name Alarm Is Active.Value
  • Enable the property to Set Integer Tag with Alarm Active Count
    Assign the Tag name Number Of Alarms Active.
  • Enable the property to Set Integer Tag with Number Of Alarms In A Given Period
    Assign the Tag name Number Of Alarms In Last 24 Hours

Step 11

Select the Add Group button at the top of the left pane to add the Alarm Notification group.

Add Group

Step 12

Select the Save button on the toolbar at the top.

Save Button

Step 13

Save the file DemoAlarmNotification.AlarmNotification in the directory C:OPCSystemsDemo.

You can specify for this configuration to load automatically when the Service starts using Configure-Options which is described also in this Training Guide.

Step 14

Return to Configure-Tags and select each tag and note that the current number of alarms and active state are updated automatically to the appropriate tag.

Getting Started – Alarm Logging

To open a new window for Alarm Logging modification, select Configure-Alarm Logging.

Select a Windows Service to modify, the node with the green arrow is the current Service being modified. Refer to Selecting Service for more information on selecting an OAS Service.

In order to log alarms to a database you must first define the Tag Alarm Limits as described in Configure Tags of this Quick Start section.

For a complete list of all Alarm Logging properties refer to the OAS Configuration – Alarm Logging section in this help file.

Step 1

OASStart the Configure OAS application if it is not already running.

 

 

Step 2

Select Configure-Alarm Logging.

Alarm Logging

Step 3

Select the Local OAS Service by selecting the Select button next to the Network Node.

Network Node

Note: The Configure application can be used to connect to remote systems using the network node name or IP address of the remote node the OAS Service is running on.  Simply enter the IP Address or network node name of the remote OAS Service you wish to connect to and click on the Select key.

Step 4

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

Logging Group Name

Step 5

Check Logging Active in the Common Properties Tab.

Logging Active

Step 6

Select the Database Tab.

Database Tab

Step 7

Logging to SQL Server

Use the following configuration for SQL Server and SQL Server Express. The Database and Table will automatically be created for you.

Database Configuration

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:

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.

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 PostgreSQL

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

Logging to Cassandra

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

Logging to MongoDB

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

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 should be set to the directory and file name to log to.

Logging to Microsoft Access

Use the following configuration for Microsoft Access. The Database and Table will be automatically created for you.
When logging to MS Access 2007 or greater use the extension .accdb, use .mdb for the older versions of versions of Access.

Access Configuration

Use the following configuration for CSV text logging:

Note: There is no historical replay to alarm windows with CSV logging.

CSV Configuration

Step 8

Select the Add Group button to add the Alarm Logging group.

Add Group

Step 9

Select the Save button on the toolbar at the top.

Save Button

Step 10

Save the file DemoAlarmLogging.AlarmLog in the directory C:\OAS\OASDemo\.

Save Log

You can specify for this configuration to load automatically when the Service starts using Configure-Options which is described also in this Training Guide.

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.

Getting Started MQTT

To interface OAS with another MQTT Client please see the Getting Started MQTT Broker guide.

To send and receive data to a Sparkplug B Edge of Network Nodes see the Getting Started Sparkplug B Host App guide.

To enable OAS as a Sparkplug B EoN Node to interface with Host and Client Applications see the Getting Started Sparkplug B EoN Node guide.

Configure an MQTT Driver

Tags can be defined to connect to MQTT devices and software brokers with the built in MQTT Driver Interface.  The following steps can be used to setup direct communications with a MQTT Broker.

Step 1

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

 

Step 2

Select Configure-License and verify that MQTT is one of the available Drivers in the lower left of the form.  If you do not see the MQTT driver available contact support@oasiot.com to update your license.

Enabled Drivers

Note: You will need to be running Open Automation Software Version 8.26 or greater to support MQTT communications.  You can download the latest version at www.openautomationsoftware.com/downloads/open-automation-software/

Step 3

Select Configure-Drivers.

Configure Drivers

Step 4

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Network Node

Note: Optionally select the Live Data Cloud node if you are hosting Allen Bradley data over the Internet with a standard Internet connection.

Step 5

Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with MQTT Source.

Define the properties for the desired physical connection.

Note: You may need to Set Default Network Adapter for Driver Interfaces of the operating system.

Set the driver to MQTT. Enter the IP Address of the broker. The default port is 1883.

MQTT Driver Configuration

Enter the User Name and Password if required.

Keep Alive Time – Default is 60 Seconds.

Reconnect Time – Default 10 Seconds. If the connection to the broker is lost the Reconnect Time determines how long to wait before attempting to reconnect.

Optionally define a secondary failover MQTT Broker if the primary MQTT Broker fails with the property Enable Failover.

If both the primary and secondary broker are offline the Return to Online settings determines the retry frequency.

View Driver Interface Failover for more information and and video demonstrating communications failover.

Step 6

Select the Add button in the lower part of the form to add the Driver Interface as an available selection when defining Tags in the next step.

Add Driver

Note: If you need to define several Driver Interfaces you can use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Publish Selected Tags to MQTT Broker

There are 2 ways to publish data from OAS to a MQTT Broker.  Both require Tags to be setup first for the data sources you want to transfer.

Note: If you wish to receive data from a MQTT Broker just to Reading Data from MQTT Broker below.

View the following video for a complete demonstration of how to publish data to MQTT Brokers, Azure IoT, and AWS IoT Gateway.

  • 00:00 – Introduction
  • 00:23 – Set up Tags in OAS
  • 00:41 – Configure Azure IoT
  • 01:53 – Publish Selected Tags
  • 05:31 – Visual Studio Code
  • 08:00 – Step by step instructions
  • 08:12 – Bulk Publish to AWS IOT
  • 09:21 – Step by step instructions / Publish Data to AWS IOT Gateway
  • 09:33 – Bulk Publish to mqtt broker
  • 10:29 – MQTT Explorer
  • 11:20 – Step by step instructions/ Getting Started MQTT
  • 11:34 – Save button of the OAS Configuration tool

Step 1

Enable Publish Selected Tags at the bottom of the Driver configuration.

Step 2

Select to publish data continuously at a specified interval, based on event, or at a specific time of day.

IoT Publish Type

If Event Driven browse for a local or remote OAS tag that will trigger the publish.  Select a Boolean tag that will change state from false to true, true to false, or both.  Or choose an Integer tag that trigger a publish anytime the value changes other than 0.

IoT Publish by Event

Step 3

Enable Publish Latest Value Only to send only the latest value of each tag when published or disable to send all value changes since the last time a publish occurred.

Enabled Include All Tags Each Publish to send at least the latest value of each tag when published or disable to only send the tags that have changed since the last publish.

Enable Publish All Tags As One Topic to publish all tag values as one topic or disable to send each tag as its own topic.

IoT Publish Options

See examples in Step 6 below for each selectable option.

Step 4

Specify the Publish Topic Id if choosing to Publish All Tags As One Topic.

Specify the Tag Id, Value Id, an optional Quality Id, and Timestamp Id for each tag value that is sent.

IoT Publish Ids

When including the Timestamp Id also specify the timestamp format, use Custom to specify your own date and time format.

Step 5

Specify local and remote OAS tag variables to include in each publish and specify the Id.  Value is the current value from the data source or you can select any of the over 600 tag variables of each tag to publish.

IoT Publish Tags

Optionally use CSV Export and CSV Import buttons to set up additional tags to publish using Microsoft Excel.

When selecting remote tags use Basic Networking syntax or Live Data Cloud syntax in the tag path.

Step 6

Select Apply Changes to begin publishing to AWS IoT Gateway.  Select Save to save the new driver configuration within the tag file.

Examples:

Examples of publishing every 2 seconds with each tag value changing every second:

IoT Publish Options

Topic: oas_tags
{
  “values”: [
    {
      “id”: “Ramp”,
      “value”: 39,
      “quality”: true,
      “timestamp”: “2022-03-21T08:55:39.000Z”
    },
    {
      “id”: “Sine”,
      “value”: 0.8090169943749475,
      “quality”: true,
      “timestamp”: “2022-03-21T08:55:39.000Z”
    },
    {
      “id”: “Random”,
      “value”: 10,
      “quality”: true,
      “timestamp”: “2022-03-21T08:55:39.000Z”
    }
  ]
}
 
IoT Publish All Value Chagnes
 
Topic: oas_tags
{
  “values”: [
    {
      “id”: “Ramp”,
      “value”: 16,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:36.000Z”
    },
    {
      “id”: “Sine”,
      “value”: 0.587785252292473,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:36.000Z”
    },
    {
      “id”: “Random”,
      “value”: 96,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:36.000Z”
    },
    {
      “id”: “Ramp”,
      “value”: 17,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:37.000Z”
    },
    {
      “id”: “Sine”,
      “value”: 0.6691306063588583,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:37.000Z”
    },
    {
      “id”: “Random”,
      “value”: 26,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:37.000Z”
    }
  ]
}
 
IoT Publish Tag Id Topics
 
Topic: Ramp
{
  “value”: 35,
  “quality”: true,
  “timestamp”: “2022-03-21T09:07:15.000Z”
}
Topic: Sine
{
  “value”: -1,
  “quality”: true,
  “timestamp”: “2022-03-21T09:07:15.000Z”
}
Topic: Random
{
  “value”: 83,
  “quality”: true,
  “timestamp”: “2022-03-21T09:07:15.000Z”
}
 

Use Data Route to Send Data to MQTT

Step 1

See Getting Started – Data Route to define a Target tag in any source tag.

Reading Data from MQTT Broker

Step 1

Select Configure-Tags.

Configure Tags

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Network Node

Note: Optionally select the Live Data Cloud node if you are hosting Allen Bradley data over the Internet with a standard Internet connection.

Step 2

Select to Add a Tag.

Note: You can also add organizational Groups as many levels deep as you prefer and add tags to groups.  To do this first add a Group to Tags Group at the root level, then right click on the Group in the right window to add additional Groups or Tags.

Add Group

Step 3

Change the Data Source Tag property to MQTT.

Data Source MQTT

Step 4

Select the correct Driver Interface from the Driver Interface pull down list.

Step 5

Enter the topic.

MQTT Topic

Step 6

Select the Quality of Service.

Step 7

Set the Topic Timeout – 0 = Topic will never timeout. Any number greater than 0 will cause the data to be Bad Data Quality if the broker does not publish within the time frame specified.

MQTT Topic Timeout

Step 8

Select to include Timestamp and or Data Quality to the topic.

This will publish to the specified topic above OAS/Items Sent/Timestamp  and or OAS/ItemsSent/Quality.

MQTT Settings

Configuring the Default Network Adapter

If the communications for the MQTT driver is not working at all you may need to set the default network adapter priority in the operating system.

Step 9

To setup automated data transfer of any OAS Tag to any MQTT Broker see Getting-Started – Data Route and set the Target Destination to MQTT.

Step 10

To define multiple tags use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Note: You can also programmatically define Tags using the free to use OASConfig .NET Standard assembly,  OPCSystems .NET Framework 4 assembly, or REST API.

Step 11

Select the Save button on the toolbar at the top.

Save Button

Step 12

Create a directory on the local C: drive with the name OASDemo.

Save the file DemoTags.tags in the directory C:\OASDemo.  Of course use the correct path for Linux.

Save Tags

Step 13

Under Configure – Options set the Default Tag Configuration File so when the computer restarts the tag file will automatically be loaded.

View Post

Getting Started Siemens

Open Automation Software Tags can be defined to connect directly to Siemens controllers with the built in Siemens Driver Interfaces which support communications over Ethernet to S7-200, S7-300, S7-400, S7-1200, and S7-1500.

The following steps can be used to setup direct communications with Siemens controllers.

Step 1

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

Step 2

Select Configure-License and verify that Siemens is one of the available Drivers in the lower left of the form.  If you do not Siemens driver available contact support@oasiot.com to update your license.

Drivers

Note: You will need to be running Open Automation Software Version 8.0.0.10 or greater to support direct Siemens communications.  You can download the latest version from our downloads page.

Step 3

Select Configure-Drivers.

Configure Drivers

Step 4

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Note: Optionally select the Live Data Cloud node if you are hosting Siemens data over the Internet with a standard Internet connection.

Step 5

Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with a Siemens Data Source.

Set the Driver to Siemens

Define the properties for the desired physical connection.

Note: You may need to Set Default Network Adapter for Driver Interfaces of the operating system.

Siemens Driver Configuration

Note: When connecting to a S7-200 append the TSAP Local and Remote to the IP Address. Ex: 192.168.1.1.1000,1000.

Here is a link to the Siemens Documentation on TSAP: https://support.industry.siemens.com/tf/ww/en/posts/is-tsap-hard-to-understand/26160/?page=0&pageSize=10#top

Optionally define a secondary failover of controller if the primary controller fails with the property Enable Failover.


If both the primary and secondary controllers are offline the Return to Online settings determines the retry frequency.

View Driver Interface Failover for more information and and video demonstrating communications failover.

Step 6

Select the Add Driver above the Driver list in the left pane to add the Driver Interface as an available selection when defining Tags in the next step.

Add Driver

Note: If you need to define several Driver Interfaces you can use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Step 7

Select Configure-Tags.

Configure Drivers

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Network Node

Note: Optionally select the Live Data Cloud node if you are hosting Modbus data over the Internet with a standard Internet connection.

Step 8

Select to Add a Tag.

Note: You can also add organizational Groups as many levels deep as you prefer and add tags to groups.  To do this first add a Group to the root level, then right click on the Group in the right window to add additional Groups or Tags.

Add Group

Step 9

Change the Data Source Tag property to Siemens.

Data Source Siemens

Step 10

Select the correct Driver Interface from the Driver Interface pull down list.

Select Driver Siemens

Step 11

Specify the desired Polling Rate for the Tag.

Specify the Address of the variable to read and write to and Apply Changes.

See Siemens Address Syntax how to define memory addresses.

Note: If error code 0x00000005 – Address does not exist or is out of range is returned as a system error uncheck Optimized block access attribute of dbOptimized in the controller program and re-compile and upload to the controller.

Step 12

To define multiple tags use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Note: You can also programmatically define Tags using the free to use OPC Systems component as demonstrated in the Form FormConfigureCSV in the WinForm Example Code application that installs with Open Automation Software in the Program Group Open Automation Software.  This component can be used in any .NET application includes Web Services, Windows Services, WPF Applications, and ASP.NET or .NET MVC Web Applications.

Step 13

Select the Save button on the toolbar at the top.

Save

Step 14

Create a directory on the local C: drive with the name OASDemo.

Save the file DemoTags.tags in the directory C:OASDemo.

Save Tags

Step 15

Under Configure – Options set the Default Tag Configuration File so when the computer restarts the tag file will automatically be loaded.

Getting Started Allen Bradley

Open Automation Software Tags can be defined to connect directly to Allen Bradley controllers with the built in ABLogix and ABClassic Driver Interfaces which support communications over Ethernet to ControlLogix, CompactLogix, GuardLogix, and Micro800 with the ABLogix driver, and MicroLogix, SLC 500, and PLC-5 with the ABClassic driver. The following steps can be used to setup direct communications with Allen Bradley controllers.

Step 1

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

Step 2

Select Configure-License and verify that ABLogix or ABClassic is one of the available Drivers in the lower left of the form.  If you do not see either AB drivers available support@oasiot.com to update your license.

Drivers

Note: You will need to be running Open Automation Software Version 8 or greater to support direct Allen Bradley communications.  You can download the latest version at www.openautomationsoftware.com/downloads/open-automation-software/

Step 3

Select Configure-Drivers.

Configure Drivers

Step 4

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Network Node

Note: Optionally select the Live Data Cloud node if you are hosting Allen Bradley data over the Internet with a standard Internet connection.

Step 5

Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with an AB Data Source.

Define the properties for the desired physical connection.

Note: You may need to Set Default Network Adapter for Driver Interfaces of the operating system.

Allen Bradley Driver Properties

Note: Specify the Driver to:

ABLogix for ControlLogix, CompactLogix, GuardLogix, and Micro800

ABClassic for MicroLogix, SLC 500, and PLC-5.

Note: To increase the processor overall speed in response in the logix 5000 program right click on the processor in the tree and select properties. In the Advanced Tag you can adjust System Overhead Time Slice. Increasing this value will increase the communications throughput. The Default is 20%:

Optionally define a secondary failover of controller if the primary controller fails with the property Enable Failover.

If both the primary and secondary controllers are offline the Return to Online settings determines the retry frequency.

View Driver Interface Failover for more information and and video demonstrating communications failover.

Step 6

Select the Add button in the lower part of the form to add the Driver Interface as an available selection when defining Tags in the next step.

Add Driver

Note: If you need to define several Driver Interfaces you can use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Step 7

Select Configure-Tags.

Configure Tags

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Network Node

Note: Optionally select the Live Data Cloud node if you are hosting Allen Bradley data over the Internet with a standard Internet connection.

Step 8

Select to Add a Tag.

Note: You may want to use the One Click Allen Bradley to add tags from the control program automatically.  If so view the following:

One Click Allen Bradley Video

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

Note: You can also add organizational Groups as many levels deep as you prefer and add tags to groups.  To do this first add a Group to the root level, then right click on the Group in the right window to add additional Groups or Tags.

Add Group

Step 9

Change the Data Source Tag property to ABLogix or ABClassic.

Allen Bradley Classic

Step 10

Select the correct Driver Interface from the Driver Interface pull down list.

Allen Bradley Driver

Step 11

Specify the desired Polling Rate for the Tag.

Specify the Address of the variable to read and write to.

Select Apply Changes and verify the Value and data quality is good.

If the communications for the Allen Bradley driver is not working at all you may need to set the default network adapter priority in the operating system.

Step 12

To define multiple tags use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Note: You can also programmatically define Tags using the free to use OPC Systems component as demonstrated in the Form FormConfigureCSV in the WinForm Example Code application that installs with Open Automation Software in the Program Group Open Automation Software.  This component can be used in any .NET application includes Web Services, Windows Services, WPF Applications, and ASP.NET or .NET MVC Web Applications.

Step 13

Select the Save button on the toolbar at the top.

Save

Step 14

Create a directory on the local C: drive with the name OASDemo.

Save the file DemoTags.tags in the directory C:OASDemo.

Save Tags

Step 15

Under Configure – Options set the Default Tag Configuration File so when the computer restarts the tag file will automatically be loaded.

Getting Started Modbus

Open Automation Software Tags can be defined to connect directly to Modbus slave devices or host data to Modbus masters with the built in Modbus Driver Interface which supports communications over Ethernet and Serial interfaces for Modbus TCP, Modbus RTU, and Modbus ASCII protocols.

You can view the Getting Started with Modbus Video to familiarize yourself with the following steps to setup Modbus communications.

  • 00:00 – Introduction
  • 00:30 – Configure OAS Application
  • 02:26 – How to Configure Tags
  • 03:00 – Data Type
  • 04:33 – Address for memory location
  • 04:49 – Modbus Data Type
  • 05:26 – Simulator Communication
  • 06:30 – Data Route Functionality
  • 07:43 – Tag Management
  • 07:46 – CSV Export
  • 08:35 – Set Up Tags Programmatically
  • 08:56 – Data Destinations
  • 09:22 – Save Tag Configuration
  • 09:54 – Further Questions

The following steps can be used to setup direct communications with Modbus devices.

Step 1

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

Step 2

Select Configure-License and verify that Modbus is one of the available Drivers in the lower left of the form.  If you do not see Modbus available contact support@oasiot.com to update your license.

Drivers

Note: You will need to be running Open Automation Software Version 8 or greater to support direct Modbus communications.  You can download the latest version at www.openautomationsoftware.com/downloads/open-automation-software/

Step 3

Select Configure-Drivers.

Configure Drivers

Step 4

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Network Node

Note: Optionally select the Live Data Cloud node if you are hosting Modbus data over the Internet with a standard Internet connection.

Step 5

Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with a Modbus Data Source.

Specify the Connection as Ethernet or Serial.

Specify the Modbus Type as Master or Slave.

Master will be used when communicating to a Modbus device.

Slave will be used when other Modbus masters will be communicating to OAS.

Note: When setting up a Slave interface over Ethernet set the IP Address to the computer IPv4 IP address or network node name if the master is on a remote PC.  You can also use 127.0.0.1 or localhost if the Modbus master will be on the same computer.

Define the properties for the desired physical connection.

Note: The Device Address is defined at the Tag level in the next step.

Note: If you are using a Connection of Ethernet you may need to Set Default Network Adapter for Driver Interfaces.

Modbus Driver Configuration

Modbus Driver Configuration

Note: When using Ethernet as a Master you can setup multiple Driver Interfaces to the same IP Address to provide parallel processing when there are a lot of tags defined to the same IP Address and the Modbus device is slow to respond.

Optionally define a secondary failover device if the primary device fails with the property Enable Failover.


If both the primary and secondary device are offline the Return to Online settings determines the retry frequency.

View Driver Interface Failover for more information and and video demonstrating communications failover.

Step 6

Select the Add button in the lower part of the form to add the Driver Interface as an available selection when defining Tags in the next step.

Add Driver

Note: If you need to define several Driver Interfaces you can use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Step 7

Select Configure-Tags.

Configure Tags

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Getting Started Modbus 3

Note: Optionally select the Live Data Cloud node if you are hosting Modbus data over the Internet with a standard Internet connection.

Step 8

Select to Add a Tag.

Note: You can also add organizational Groups as many levels deep as you prefer and add tags to groups.  To do this first add a Group to the root level, then right click on the Group in the right window to add additional Groups or Tags.

Add Group

Step 9

Change the Data Source Tag property to Modbus.

Data Source Modbus

Step 10

Specify the desired Polling Rate for the Tag.

Specify the Device Address (set as -1 if it is not to be used on Ethernet)

Step 11

Select the correct Driver Interface from the Driver Interface pull down list.

Select Modbus Driver

Step 12

Select the correct Memory Type from the Memory Type pull down.

Modbus Holding Register

Step 13

For Input Register and Holding Register Memory Type select the correct Modbus Data Type.

Modbus Data Type

Note: Use the “As Boolean” types to access bits of a 16, 32, or 64 bit Integer.

Step 14

Specify the Address for the memory location.

Modbus Memory Location

Note: Zero Based Addressing will subtract 1 from the address when communicating to the device.

The base of the memory type will be added to the Address.

Example: Communicating to Holding Register 40000 the Memory Type will be Holding Register and the Address would be 1.

Extended addressing is also supported.

To communicate to 410001 set the Memory Type to Holding Register and the address to 10001.

To communicate to 465535 set the address to 65535.

Following are some examples.

  • To access 40,001 use address of 1
    To access 49,999 use address of 9,999
    To access 50,000 use address of 10,000
    To access 410,001 use address of 10,001
    To access 420,000 use address of 20,000
    To access 430,000 use address of 30,000
    To access 440,000 use address of 40,000
    To access 450,000 use address of 50,000
    To access 460,000 use address of 60,000
    To access 465,535 use address of 65,535

Step 15

To define multiple tags use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Note: You can also programmatically define Tags and Drivers using the OPCSystems .NET component with the TagCSVImport and DriverInterfaceCSVImport methods or the REST API.

Step 16

Select the Save button on the toolbar at the top.

Save Button

Step 17

Create a directory on the local C: drive with the name OASDemo.

Save the file DemoTags.tags in the directory C:\OASDemo.

Save Tags

Step 18

Under Configure – Options set the Default Tag Configuration File so when the computer restarts the tag file will automatically be loaded.

Getting Started – Web HMI

The following content will get you started with Web HMI, building your own web user interfaces with real time data. If you are interested in visualizing your data in a desktop or mobile browser with zero programming, you may be interested in Getting Started with the Web HMI Dashboard.

For full reference information on Web HMI visit Programming Reference – Web HMI

View the following video to see how to use Web HMI to create user interfaces.

  • 00:00 – Introduction
  • 00:07 – What’s HMI?
  • 00:54 – Open Standards
  • 01:03 – Web HMI utilizes a direct line of communication
  • 01:23 – What can be built with Web HMI?
  • 02:51 – Setting Up the server
  • 02:57 – First Step – Registering a listener on the server
  • 03:40 – Configure Tags
  • 04:25 – Writing Code
  • 05:47 – Text Editor
  • 06:07 – HTML attributes
  • 14:12 – Develop Same Functionality Programmatically
  • 18:30 – More Information

Step 1

Configure Web Services within the OAS Platform. For instructions on how to accomplish this as well as optionally using SSL for secure communications, see the following article:
Configuring OAS Web Services


Step 2

Create a project directory. (Example C:\myWebHMI)


Step 3

Copy the 4 supplied files from C:\Program Files\Open Automation Software\OAS\HTML_HMI, js and css subdirectories to your project directory keeping the directory structure just the same.


Directories
1. js/lib/jquery-1.8.3.min.js
2. js/lib/json2.js
3. js/opc-lib-min.js
4. css/opc-style.css

Note: You can use any version of jQuery as long as it is v1.8 or greater, and the json2 library is only necessary for older browsers such as IE 8.


Step 4

Open/create a new text document and add the following minimum code:

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" src="js/lib/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="js/opc-lib-min.js"></script>
        <script type="text/javascript" src="js/lib/json2.js"></script>
        <link rel="stylesheet" stype="text/css" href="css/opc-style.css"/>
        <script type="text/javascript">
            OAS_config = {
                token:'7e61b230-481d-4551-b24b-ba9046e3d8f2',
                serverURL: 'http://localhost:58725'
            };
        </script>
    </head>
    <body>
    </body>
</html>

Networking

In the web page set the serverURL to the IP Address, Network Node Name, or registered domain name of the Linux or Windows devices where the OAS Engine located.

serverURL: 'http://192.168.0.1:58725'

Specify the tag names in the HTML code as local tags.  The web browser can be run locally or remotely, it will communicate to the server specified in the serverURL as a relative path for the tag values.  In this example the tags would be running on the same server as 192.168.0.1 and the content in the page would reference the tag as local even if the client browsers are running on remote devices.

Local Tag

myGroup.myTag.Value

If the tag is located on a different system than the serverURL or you want to host data from multiple OAS Engines use the Remote Tag Access syntax.

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

Step 5

If you are new to HTML code use the HTML Wizard code generator at http://opcweb.com/wizard/ to generate the code for you.

HTML Wizard
HTML Wizard

In the body add the following code to display the Ramp tag value:

<div>Ramp Value =  <label id="txt1" oas-tag-txt='{"tag":"Ramp.Value","config":{"formats":{"bad_q":"?????","float":"0.0"}}}' ></label></div>

Step 6

Below the Ramp code add the following code to display the Pump tag Value:

<div>Pump Value = <label id="txt2" oas-tag-txt='{"tag":"Pump.Value","config":{"formats":{"bad_q":"?????"}}}' ></label></div>

Step 7

Finally below the Pump code add the following to create a button that will allow you to “Toggle” the Pump Value.

<div><button id="tog2" oas-tag-set='{"tag":"Pump.Value","config":{"evt":"click","offset":0,"set":"toggle","set_src":""}}'>Toggle Pump</button></div>

NOTE: To be able to set a value (write to it) it must first be setup to read in the web application.


Step 8

Save your file as myWebHMI.html

Web HMI Getting Started 3


Step 9

Deploy the your application to any web server. This can be IIS on Windows, or any HTTP server on Linux, and even cloud hosting services.


Step 10

To see the results open a browser to the location of your HTML file.


Full Source Code

Your final code should look like this:

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" src="js/lib/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="js/opc-lib-min.js"></script>
        <script type="text/javascript" src="js/lib/json2.js"></script>
        <link rel="stylesheet" stype="text/css" href="css/opc-style.css"/>
        <script type="text/javascript">
            OAS_config = {
                token:'7e61b230-481d-4551-b24b-ba9046e3d8f2',
                serverURL: 'http://localhost:58725'
            };
        </script>
    </head>
    <body>
    <div>Ramp Value =  <label id="txt1" oas-tag-txt='{"tag":"Ramp.Value","config":{"formats":{"bad_q":"?????","float":"0.0"}}}' ></label></div>
    <div>Pump Value = <label id="txt2" oas-tag-txt='{"tag":"Pump.Value","config":{"formats":{"bad_q":"?????"}}}' ></label></div>
    <div><button id="tog2" oas-tag-set='{"tag":"Pump.Value","config":{"evt":"click","offset":0,"set":"toggle","set_src":""}}'>Toggle Pump</button></div>
    </body>
</html>

NOTE: To be able to set a value (write to it) it must first be setup to read in the web application.

Open Automation Software provides a tool for automatically creating the HTML code to read and write to Open Automation Software Tags using the HTML HMI Wizard.