Getting Started Sparkplug B Edge of Network Node

OAS is can act as a Sparkplug B Edge of Network Node and Host Application.

The following guide are the steps to define OAS as a Sparkplug B EoN Node to enable OAS Tags as Metric values to Sparkplug B clients acting as a Host Application for Edge Node and Device control and client applications to send and receive tag values of any OAS Data Source.

If you would like OAS to act as a Host Application to control and send and receive data from other Edge of Network Node Devices see the Getting Started Sparkplug B Host Application guide.

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

Step 1 – Check MQTT License

OAS

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

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.

NOTE: To configure remote OAS Engines enter the IP Address or node name in the Network Node field and click on Select.

Network Node
Enabled Drivers

NOTE: You will need to be running Open Automation Software Version 19.0.0.54 or greater to support Sparkplug B communications.  Use Configure-Options-System Status to check the version of the running OAS Engine.  You can download the latest version at www.openautomationsoftware.com/downloads/open-automation-software/ or use the Update Version button under Configure-License to update to the latest version of OAS.

Step 2 – Configure Sparkplug B Edge of Network Node Driver

Select Configure-Drivers.

Configure Drivers

Define the properties for the desired Sparkplug B Edge Node.

Enter a meaningful Driver Interface Name.

Set the Driver property to Sparkplug B.

Enter the Host property to the IP Address of the of the host broker or just use localhost for a local broker. 

Set the Port property of the host broker to connect to.  The default port is 1883 or 8883 for SSL.

Note: The OAS MQTT Broker can be used to host data locally.  To use another broker on the default ports on the same computer change the OAS MQTT Broker Port under Configure-Options-MQTT Broker.

Enter the User Name and Password if required.

Keep Alive Time – Default is 60 Seconds.

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

To connect with Transport Layer Security enable the property SSL / TLS.

Specify the Private Key File and Certificate File to use.

Uncheck the property Create Certificate to specify a PFX Certificate File and PFX Certificate Password.

Set the MQTT Protocol Version to V311 or V500.

Set the Client ID to a unique value, each driver interface must have a specific value different than all other clients connecting to the host.

Optionally define a secondary failover Host Broker if the primary Host 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.

Set the Mode to Edge Node.

Set the Hode Mode to Remote Hosted if a Host Application to control the state of this Edge Node including another OAS driver set as Host App.  Set to Self Hosted to have this OAS driver control the state of the Edge Node.

Set the Host ID to the specific value that the Edge of Nodes will be using as the Host Application ID.

Set the Sparkplug B Version to 2.2 or 3.0.

Set the Group ID and Edge Node ID that defines this EoN Node.

NOTE: This Group ID and Edge Node ID values will be used to define which OAS tags will be enabled for hosting values in the next step to Define OAS Tags as EoN Node using the Host Group ID and Host Edge Node ID tag properties.

Optionally set the Device ID Filter to include only a specific device defined by the Tag property Host Device ID.  Leave blank to include all tags with all Host Device IDs defined with same Group ID and Edge Node ID.

Select the Add Driver button in the left part of the window 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.

CSV Import and Export

You can also programmatically define drivers using the .NET OASConfig assembly or OAS REST API.

Step 3 – Configure OAS Tags as Sparkplug B EoN Node and Device Metrics

Select Configure-Tags.

Menu Configure Tags

Select an existing tag or add a new tag.

To update an existing tag jump to the step to specify the Host Group ID and Host Edge Node ID.

To add a new tag select Add Group to add a group to place tags in.

Add Group
Add Tag Group

NOTE: You can 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.

Tag Group Options

Select Add Tag to add a tag to the group selected.

Add Tag
Add Tag to Group

The Data Source can be any OAS Data Source including Allen Bradley PLCs, Siemens controllers, Modbus devices or masters, OPC UA servers and clients, OPC DA servers and clients, MQTT brokers and clients, MTConnect, Calculations, Simulation, or other Sparkplug B Node Metrics.

Specify the Host Group ID and Host Edge Node ID to match the Group ID and Edge Node ID defined in the Edge Node Driver Interface.

Set the Host Device ID and Host Metric Name to any value you desire.  Optionally leave the Host Device ID blank if you want the Metric to appear directly in the Edge Node.  Each OAS tag must have a unique combination of Host Group ID, Edge Node ID, Device ID, and Metric Name.  Two or more tags cannot share the same combination.

Select Apply Changes and the OAS tag value will be published to the specified Host anytime the tag value changes. 

Apply Changes

The value can also be updated with a NCMD or DCMD command to the specific Metric Name.  If the OAS Tag is defined to another Data Source the value will be written to that source.

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

CSV Import and Export

When exporting tags choose which columns to include in the CSV file. There are over 800 properties available for use in each tag and reducing the amount of data can help to focus on the properties of interest.

Sparkplug B CSV Export

NOTE: You can also programmatically define Tags using the free to use .NET OASConfig assembly or OAS REST API.

Step 4 – Save Sparkplug B Tags and Drivers

Select the Save button on the toolbar at the top.

Load and Save

Enter a file name to be saved in C:\ProgramData\OpenAutomationSoftware\ConfigFiles directory on Windows or ConfigFiles subdirectory on Linux.

When prompted to set the file as the default configuration to load on startup select Yes.

Set Default Tag File

NOTE: The tags and and drivers are both saved into one file.

The tags defined are now ready for use in all OAS features like Data Logging, Data Route, and Open UIEngine.