How to Visualize Sparkplug B Data in a WPF .NET Application

Sparkplug B WPF
Sparkplug B WPF


Open Automation Software can connect directly to Sparkplug B Edge of Network Node devices to read Metric data. All OAS data can be viewed with a Windows Presentation Foundation .NET application. OAS Host Application interface also supports writes to Sparkplug B Metric values, providing updates from WPF. This tutorial walks you through downloading and installing OAS, configuring a Sparkplug B driver, automating tag creation with the Host Application interface, and visualizing tag data in .NET WPF with either C# or VB. Programming is not required if you use the designer interface.

Step 1. Download and Install the Open Automation Software and Start the OAS Service

If you have not already done so, you will need to download and install the OAS platform.  Fully functional trial versions of the software are available for Windows, Windows IoT Core, Linux, Raspberry Pi and Docker on our downloads page.

On Windows run the downloaded Setup.exe file to install one or more of the Open Automation Software features. Select the default Typical installation if you are not sure what features to use or the Custom installation if you want to save disk space on the target system.  When prompted agree to the End User License Agreement to continue the installation.

For more detailed instructions and video tutorials, visit the installation guide for your system:
Windows Installation | Linux Installation | Raspberry Pi Installation | Dockers Installation

When the installation is finished the OAS Service Control application will appear.  Use this application to start the 4 Services. If this is the first time installing the software it will automatically enter Runtime with an example Tag Configuration.


Step 2. Set Up Sparkplug B Host App to Access EoN Node Data.

Select Configure-Drivers.

Configure Drivers

Enter a meaningful Driver Interface Name that you will refer to this connection and define the properties.

Set the driver 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.

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.

Set the Mode to Host App for OAS to control the online state of each Edge of Node defined to the shared Host Application ID. Or set to Client App to access EoN Node data without controlling their state.

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.

To automatically add tags for each Metric from the matching Group, Edge of Nodes, and Devices enable the property Add Client Tags Automatically.

When enabled optionally set the Filter Groups, Edge Nodes, and Devices that tags should be added from for each of their Metrics.  Leave the Filter fields blank to include all Edge of Nodes publishing data to the broker.

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

Add Driver

You are now ready to add tags for specific Sparkplug B EoN Node Metric values.

Note: If the Driver Interface property Add Client Tags Automatically was enabled tags will be created for you, you can skip this step to add tags manually.

Select Configure-Tags.

Menu Configure Tags

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 Tags Group at the root level, then right click on the Group in the right window to add additional Groups or Tags.

Select Add Tag.

Add Tag

Change the Data Source Tag property to Sparkplug B.

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

Specify the Client Group IDClient Edge Node IDClient Device ID, and Client Metric Name for the Edge of Node Metric value to read and write.

Select the Data Type of the Tag to match the data type of the Metric.

Select Apply Changes and the current value for the Metric should appear with Good Quality.

Select the Save button from the toolbar to save your configuration.

Save Button

You can view the Getting Started with Sparkplug B Video to familiarize yourself with the above steps to setup OAS as a Sparkplug B Edge of Network Node and a Host Application

  • 00:00 – Introduction
  • 01:10 – Download OAS
  • 01:46 – Quick Start
  • 02:08 – Edge of Network Node
  • 05:52 – EoN Tags
  • 07:04 – Host Application
  • 09:20 – SpB Client Tags
  • 10:22 – Programatic Interface
  • 10:59 – CSV Export / Import
  • 12:27 – Multiple Metric Tags
  • 13:46 – Modbus
  • 16:10 – DCMD Metric Write
  • 17:00 – Data Route
  • 17:58 – Networking
  • 18:17 – Save Configuration
  • 18:56 – OAS Platform

Step 3. Visualize Your Data with .NET

Project Setup
HMI applications can be developed using Microsoft Visual Studio 2010 (or later). Programming is not required if you use the visual editor.

Open your existing Visual Studio application or start a new one, either VB or C#. Specify WPF App (.NET Framework) as the project type.


Verify that the Target Framework is Version 4.61 or greater.

If you have installed Open Automation Software after installing Visual Studio you should see the Open Automation Software group in your toolbox.  If it is not there you can add a reference in your project to the OPCWPFDashboard.dll.  It will be in your installation folder, most likely: C:\Program Files\Open Automation Software\OAS. Add the tools by right clicking on the toolbox and selecting Choose Items.  In the Choose Toolbox Items dialog box under the WPF tab, select all of the items that start with OPCWPF and say OK.

Add a Viewbox
If you are unfamiliar with the Viewbox control in WPF it is very useful. By setting it’s Stretch property to Uniform, it will automatically transform it’s contents to fit the user’s screen.  It is easier to develop with the Stretch Property set to “None” and then set it back to “Uniform” at the end. You will want your Grid inside of your Viewbox. Your XAML should look like this:


Add a Label Control
Add an OPCWPFLabel control to the window by double clicking on it in the toolbox. Set the Content_Tag property of the label to the Tag property that you want the label to display. Do this by either typing it in the box if you know the name (they are case-sensitive) or use the ellipse next to the property box. If you are using the demo tag configuration that installs with Open Automation Software use Ramp.Value.


Referencing Tags
In the tag browser, you will need to select your network node and then the tag and the property you want to display. Your network node will be the location you have Open Automation Software installed on. If it is your local machine, it will be localhost, otherwise, it could be a registered domain name or an IP address. Here are some examples of referencing tags based on their location:

Local Tag:
myTag.Value

Local Tag in a Group:
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 from Remote OAS Engine
\\192.168.0.1\RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Add a Button Control
Next, add a button to the window by double clicking on OPCWPFButton on the toolbox.  Use the Pump tag for the button, it is a Boolean data type. Set Content_Tag in the properties window to Pump.Value. In the ContentFormatBooleanFalse property enter The Pump is On and the in the ContentFormatBooleanTrue property enter The Pump is Off.  That way the button text will be something more meaningful than simply True or False.

To change the color of the button when it’s value changes, use the Background01_Tag property.  Set it to Pump.Value.  The BackgroundFalse and BackgroundQualityBad properties control the background color for when the value is false and bad quality.

Next, SetValue_Tag property to Pump.Value.  This specifies what value to change when the button is clicked.

Add a Radial Gauge
Drag an OPCWPFRadialGauge onto the screen. Click the ellipse next to the Needles property. This will open the Needles Collection dialog box. Click the Add button.  This adds a Needle to the Radial Gauge. Set the Value_Tag property to Ramp.Value, the Ramp Tag again.  It is a Float Data Type, enter 0 for the ValueFormatFloat property. 


Click F5 to compile and run your project. Your screen should look similar to this.


For more detailed instructions on using OAS with WPF, visit .NET WPF HMI in our knowledge base or watch the video below:

Also, see Getting Started – .NET Trend and Getting Started – .NET Alarm.

Bad Data Quality in .NET Application.

Below are some possible reasons your .NET application is not able to read OAS tag values.

Data Source Quality

Use Configure-Tags to verify that the data quality of the source tags is “Good Quality”.

Menu Configure Tags

Quality Good

Security

The Default security group on either the local or remote OAS Engine may have Disable All Tags from Reading checked under the Read Tags Tab.  See Restrict Tag Access of Security setup to see how read, write, and browse access can be restricted.

View how to Implement User Credentials in Client Applications to provide log in method for each user in the .NET application.

Network

.NET applications can be defined to communicate to remote OAS Engines.  See Network Communications Troubleshooting to verify that port 58727 is allowing both incoming and outgoing traffic through your firewall.

Tag Path

The full tag path would include the full tag name including its parent groups and the variable of the Tag.

MyGroup.MyTag.Value

Tag names are case sensitive and the current value of a tag would be .Value as the most common variable.

If the tag is from a remote OAS Engine see Basic Networking for standard remote tag syntax or Live Data Cloud Networking if the OAS Engine system has a dynamic IP address.
\\192.168.0.1\TagName.Value

License

Use Configure-License to verify that a product feature .NET Data Connector, WinForm HMI, or WPF HMI is enabled on the data source system where the tags are located.

Menu Configure License

Enabled Products

Target Framework for WPF and WinForm Applications

The project type for WinForm and WPF applications should be set to include (.NET Framework) and target .NET Framework 4.6.1 or greater.

WinForm Target Framework

See the correct project type for WinForm above that is listed as Windows Forms App (.NET Framework) while Windows Forms App would not be the correct project type.

Assembly References

Visual Studio on some operating systems will assign a legacy assembly to the project causing an incompatibility due to an older version of the reference assembly.  A common assembly that can be incorrect is Newtonsoft.Json that has been registered in the GAC by another software product.

Select Newtonsoft.Json under the Project References to verify the correct path and version as 13.0.0.0.

Newtonsoft.Json Assembly Reference

If the Path does not reference the OAS installation directory remove the reference and select to Add Reference and browse for dll from the respective directory for the specific product feature. For .NET Framework applications include the .dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\. The Target Framework set for the VS project must be .NET Framework 4.6.1 or greater. For .NET Standard supporting the following targets include the. dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\.

See a list of locations for the correct type in the troubleshooting type After updating to OAS Version 17 the project no longer compiles for a list of correct project reference paths for each type of Visual Studio Project.

.NET Assembly is Blocked

If you have copied an application or project to another computer you may need to Unblock one or more the .dll files.

Right click on the .dll file that you have downloaded. Check the Unblock checkbox for security as shown in the example below, then click Apply or OK.

Excel Add-In

Legacy .NET Application with OAS Version 17

 If the OAS .NET assemblies are from OAS version 16 or less contact support@oasiot.com for compatibility instructions.

Tag Browse in Visual Studio Missing

Microsoft Visual Studio 2022 no longer supports custom property editors to browse for tags.

Use Visual Studio 2019 to develop WPF applications.

The free Community Edition of Visual Studio 2019 can be download from https://visualstudio.microsoft.com/vs/older-downloads/.

If you prefer Visual Studio 2022 with WPF application development use the OAS Excel Tag browser to browse for the full tag path of a remote or local tag and copy the full tag path from the Tag field and paste into the desired Tag property in Visual Studio.

After updating to OAS Version 17 the project no longer compiles

OAS version 17 implements an improved network interface which requires some additional assemblies.

All dependent .dlls are located in the relative subdirectory of the Controls directory of the OAS installation directory, typically C:\Program Files\Open Automation Software\OAS\Controls\.

To add a reference to a Visual Studio project right click on References in the Solution Explorer.

Add Reference

Select Browse to browse the directory for each application feature.

Browse Assemblies

Include all .dlls files in the respective directory for the specific product feature.

For .NET Framework applications include the .dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\.

The Target Framework set for the VS project must be .NET Framework 4.6.1 or greater.

For .NET Standard supporting the following targets include the. dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\.

  • .NET 6
  • .NET 5
  • .NET Core 2.0 or greater
  • .NET Framework 4.61 or greater
  • Xamarin.iOS 10.14 or greater
  • Xamarin.Android 8.0 or greater
  • UWP 1.0.0.16299 or greater

WPF HMI Assemblies

  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCWPFDashboard\

WinForm HMI Assemblies

  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCControls\

Alarm .NET Assemblies

  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCAlarmControl\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCAlarmDataOnly\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASAlarms\

Trend .NET Assemblies

  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCTrendControl\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCTrendDataOnly\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASTrends\

.NET Data Connector Assemblies

  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCSystemsDataConnector\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASData\

Server Configuration Assemblies

  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCSystems\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASConfig\

Troubleshooting – Visual Studio

WPF Properties Edit Ellipses Missing in VS 2022
Visual Studio 2022 design time properties no longer support custom property editors for WPF applications.  Use Visual Studio 2019 to develop WPF applications. The free Community Edition of Visual Studio 2019 can be download from https://visualstudio.microsoft.com/vs/older-downloads/. WinForm applications are still well supported in Visual Studio 2022.
Bad Data Quality in .NET Application.
Below are some possible reasons your .NET application is not able to read OAS tag values.

Data Source Quality

Use Configure-Tags to verify that the data quality of the source tags is "Good Quality". Menu Configure Tags
Quality Good

Security

The Default security group on either the local or remote OAS Engine may have Disable All Tags from Reading checked under the Read Tags Tab.  See Restrict Tag Access of Security setup to see how read, write, and browse access can be restricted. View how to Implement User Credentials in Client Applications to provide log in method for each user in the .NET application.

Network

.NET applications can be defined to communicate to remote OAS Engines.  See Network Communications Troubleshooting to verify that port 58727 is allowing both incoming and outgoing traffic through your firewall.

Tag Path

The full tag path would include the full tag name including its parent groups and the variable of the Tag.
MyGroup.MyTag.Value
Tag names are case sensitive and the current value of a tag would be .Value as the most common variable.
If the tag is from a remote OAS Engine see Basic Networking for standard remote tag syntax or Live Data Cloud Networking if the OAS Engine system has a dynamic IP address.
\\192.168.0.1\TagName.Value

License

Use Configure-License to verify that a product feature .NET Data Connector, WinForm HMI, or WPF HMI is enabled on the data source system where the tags are located. Menu Configure License
Enabled Products

Target Framework for WPF and WinForm Applications

The project type for WinForm and WPF applications should be set to include (.NET Framework) and target .NET Framework 4.6.1 or greater. WinForm Target Framework See the correct project type for WinForm above that is listed as Windows Forms App (.NET Framework) while Windows Forms App would not be the correct project type.

Assembly References

Visual Studio on some operating systems will assign a legacy assembly to the project causing an incompatibility due to an older version of the reference assembly.  A common assembly that can be incorrect is Newtonsoft.Json that has been registered in the GAC by another software product. Select Newtonsoft.Json under the Project References to verify the correct path and version as 13.0.0.0.
Newtonsoft.Json Assembly Reference If the Path does not reference the OAS installation directory remove the reference and select to Add Reference and browse for dll from the respective directory for the specific product feature. For .NET Framework applications include the .dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\. The Target Framework set for the VS project must be .NET Framework 4.6.1 or greater. For .NET Standard supporting the following targets include the. dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\. See a list of locations for the correct type in the troubleshooting type After updating to OAS Version 17 the project no longer compiles for a list of correct project reference paths for each type of Visual Studio Project.

.NET Assembly is Blocked

If you have copied an application or project to another computer you may need to Unblock one or more the .dll files. Right click on the .dll file that you have downloaded. Check the Unblock checkbox for security as shown in the example below, then click Apply or OK. Excel Add-In

Legacy .NET Application with OAS Version 17

 If the OAS .NET assemblies are from OAS version 16 or less contact support@oasiot.com for compatibility instructions.
Tag Browse in Visual Studio Missing
Microsoft Visual Studio 2022 no longer supports custom property editors to browse for tags. Use Visual Studio 2019 to develop WPF applications. The free Community Edition of Visual Studio 2019 can be download from https://visualstudio.microsoft.com/vs/older-downloads/. If you prefer Visual Studio 2022 with WPF application development use the OAS Excel Tag browser to browse for the full tag path of a remote or local tag and copy the full tag path from the Tag field and paste into the desired Tag property in Visual Studio.
After updating to OAS Version 17 the project no longer compiles
OAS version 17 implements an improved network interface which requires some additional assemblies. All dependent .dlls are located in the relative subdirectory of the Controls directory of the OAS installation directory, typically C:\Program Files\Open Automation Software\OAS\Controls\. To add a reference to a Visual Studio project right click on References in the Solution Explorer. Add Reference Select Browse to browse the directory for each application feature. Browse Assemblies Include all .dlls files in the respective directory for the specific product feature. For .NET Framework applications include the .dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\. The Target Framework set for the VS project must be .NET Framework 4.6.1 or greater. For .NET Standard supporting the following targets include the. dlls located in C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\.
  • .NET 6
  • .NET 5
  • .NET Core 2.0 or greater
  • .NET Framework 4.61 or greater
  • Xamarin.iOS 10.14 or greater
  • Xamarin.Android 8.0 or greater
  • UWP 1.0.0.16299 or greater
WPF HMI Assemblies
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCWPFDashboard\
WinForm HMI Assemblies
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCControls\
Alarm .NET Assemblies
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCAlarmControl\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCAlarmDataOnly\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASAlarms\
Trend .NET Assemblies
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCTrendControl\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCTrendDataOnly\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASTrends\
.NET Data Connector Assemblies
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCSystemsDataConnector\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASData\
Server Configuration Assemblies
  • C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCSystems\
  • C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\OASConfig\
The .NET controls do not appear in the Toolbox after selecting to add them to the Toolbox.
If you right click Toolbox and Choose to Add Items and select the OPCWPFDashboard controls, yet they do not appear in the Toolbox you may have installed Visual Studio after Open Automation Software.  If so uninstall Open Automation Software and reinstall it.  It will then register correctly with Visual Studio for adding the controls.
After updating Open Automation Software with the incremental update the project no longer compiles or the application no longer works.
Make sure to Unblock the dlls before copying to C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\ or C:\Program Files\Open Automation Software\OAS\Controls\NetStandard\.
To Unblock the files copy to a trusted location for your system, Desktop works well, then right click on the file and select Properties to select Unblock. Then copy from your Desktop to the correct directory in C:\Program Files\Open Automation Software\OAS\Controls\.
I get a thread exit message in Visual Studio 2013.
The thread exit message is a bug in Visual Studio 2013. https://connect.microsoft.com/VisualStudio/feedback/details/812144/vs2013-reports-incorrect-thread-exit-code Check to see if you have CTP 5 installed for up to date fixes. http://www.visualstudio.com/news/vs2013-update5
I receive an error stating that the Microsoft.Expression.Drawing.dll and Microsoft.Expression.Effects.dll is missing and not found.
These assemblies are included in the installation directory of Open Automation Software and can be included as a Reference in your project as local copy. Or you can install the Blend SDK from the following link that also includes these files. http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=75e13d71-7c53-4382-9592-6c07c6a00207

How to Visualize OPTO Data from a WPF .NET Application

How to Visualize OPTO Data from a WPF .NET Application

Open Automation Software Tags can be defined to connect directly to OPTO controllers with the built in OPTO Driver Interfaces which support communications over Ethernet. This tutorial walks you though downloading and installing OAS, configuring an OPTO driver, configuring tags and visualizing tag data in .NET WPF with either C# or VB. Programming is not required if you use the designer interface.

Step 1. Download and Install the Open Automation Software and Start the OAS Service

If you have not already done so, you will need to download and install the OAS platform.  Fully functional trial versions of the software are available for Windows, Windows IoT Core, Linux, Raspberry Pi and Docker on our downloads page.

On Windows run the downloaded Setup.exe file to install one or more of the Open Automation Software features. Select the default Typical installation if you are not sure what features to use or the Custom installation if you want to save disk space on the target system.  When prompted agree to the End User License Agreement to continue the installation.

For more detailed instructions and video tutorials, visit the installation guide for your system:
Windows Installation | Linux Installation | Raspberry Pi Installation | Dockers Installation

When the installation is finished the OAS Service Control application will appear.  Use this application to start the 4 Services. If this is the first time installing the software it will automatically enter Runtime with an example Tag Configuration.


Step 2. Configure Your OPTO Data Source

  1. First, you will need to open the Configure OAS application from the program group Open Automation Software.
  2. Select Configure >> License from the top menu and verify that OPTO is one of the available Drivers in the lower left of the form. The demo license will have this by default. If you do not see OPTO available, contact support@openautomationsoftware.com to update your license.
  3. Select Configure >> Drivers from the top menu.

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

  5. The Configure Drivers Screen will appear. Select OPTO from the Driver dropdown box.

  6. Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with a OPTO Data Source.
  7. Define the properties for the desired physical connection.
  8. Click Add Driver at the the top of the left portion of the window.

For more detailed instructions on configuring your OPTO data source, click here to see our Getting Started OPTO tutorial.


Step 3. Configure Your Tags

OAS provides multiple ways to add and define tags:

To add a Tag manually:

  1. In the OAS Configure Application, select Configure >> Tags from the top menu.

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

  3. Click on the Add Tag button located at the top of the Tag browser on the left portion of the screen.

  4. A dialog box will appear. Enter a name for your new tag and click ok.
  5. A configuration screen will appear for your new tag. Select your data source type in in the Data Source dropdown box.

  6. Specify the correct data type in the Data Type dropdown box.
  7. Click Apply Changes at the bottom right of the window.

For more detailed instructions on configuring your tags, click here to see our Getting Started Tags tutorial.


Step 4. Visualize Your Data with .NET

Project Setup
HMI applications can be developed using Microsoft Visual Studio 2010 (or later). Programming is not required if you use the visual editor.

Open your existing Visual Studio application or start a new one, either VB or C#. Specify WPF App (.NET Framework) as the project type.

Verify that the Target Framework is Version 4.61 or greater.

If you have installed Open Automation Software after installing Visual Studio you should see the Open Automation Software group in your toolbox.  If it is not there you can add a reference in your project to the OPCWPFDashboard.dll.  It will be in your installation folder, most likely: C:\Program Files\Open Automation Software\OAS. Add the tools by right clicking on the toolbox and selecting Choose Items.  In the Choose Toolbox Items dialog box under the WPF tab, select all of the items that start with OPCWPF and say OK.

Add a Viewbox
If you are unfamiliar with the Viewbox control in WPF it is very useful. By setting it’s Stretch property to Uniform, it will automatically transform it’s contents to fit the user’s screen.  It is easier to develop with the Stretch Property set to “None” and then set it back to “Uniform” at the end. You will want your Grid inside of your Viewbox. Your XAML should look like this:

Add a Label Control
Add an OPCWPFLabel control to the window by double clicking on it in the toolbox. Set the Content_Tag property of the label to the Tag property that you want the label to display. Do this by either typing it in the box if you know the name (they are case-sensitive) or use the ellipse next to the property box. If you are using the demo tag configuration that installs with Open Automation Software use Ramp.Value.

Referencing Tags
In the tag browser, you will need to select your network node and then the tag and the property you want to display. Your network node will be the location you have Open Automation Software installed on. If it is your local machine, it will be localhost, otherwise, it could be a registered domain name or an IP address. Here are some examples of referencing tags based on their location:

Local Tag:
myTag.Value

Local Tag in a Group:
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 from Remote OAS Engine
\\192.168.0.1\RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Add a Button Control
Next, add a button to the window by double clicking on OPCWPFButton on the toolbox.  Use the Pump tag for the button, it is a Boolean data type. Set Content_Tag in the properties window to Pump.Value. In the ContentFormatBooleanFalse property enter The Pump is On and the in the ContentFormatBooleanTrue property enter The Pump is Off.  That way the button text will be something more meaningful than simply True or False.

To change the color of the button when it’s value changes, use the Background01_Tag property.  Set it to Pump.Value.  The BackgroundFalse and BackgroundQualityBad properties control the background color for when the value is false and bad quality.

Next, SetValue_Tag property to Pump.Value.  This specifies what value to change when the button is clicked.

Add a Radial Gauge
Drag an OPCWPFRadialGauge onto the screen. Click the ellipse next to the Needles property. This will open the Needles Collection dialog box. Click the Add button.  This adds a Needle to the Radial Gauge. Set the Value_Tag property to Ramp.Value, the Ramp Tag again.  It is a Float Data Type, enter 0 for the ValueFormatFloat property. 

Click F5 to compile and run your project. Your screen should look similar to this.

For more detailed instructions on using OAS with WPF, visit .NET WPF HMI in our knowledge base or watch the video below:

Also, see Getting Started – .NET Trend and Getting Started – .NET Alarm.

How to Visualize OPC Server Data from a WPF .NET Application

How to Visualize OPC Server Data from a WPF .NET Application

Open Automation Software Tags can be defined to connect to Classic OPC Data Access 2.xx and 3.0 Servers with the built in OPC Interface. This tutorial walks you though downloading and installing OAS, configuring an OPC Server, configuring tags and visualizing tag data in .NET WPF with either C# or VB. Programming is not required if you use the designer interface.

Step 1. Download and Install the Open Automation Software and Start the OAS Service

If you have not already done so, you will need to download and install the OAS platform.  Fully functional trial versions of the software are available for Windows, Windows IoT Core, Linux, Raspberry Pi and Docker on our downloads page.

On Windows run the downloaded Setup.exe file to install one or more of the Open Automation Software features. Select the default Typical installation if you are not sure what features to use or the Custom installation if you want to save disk space on the target system.  When prompted agree to the End User License Agreement to continue the installation.

For more detailed instructions and video tutorials, visit the installation guide for your system:
Windows Installation | Linux Installation | Raspberry Pi Installation | Dockers Installation

When the installation is finished the OAS Service Control application will appear.  Use this application to start the 4 Services. If this is the first time installing the software it will automatically enter Runtime with an example Tag Configuration.


Step 2. Configure OPC Server Tags

OAS provides multiple ways to add and define tags:

To add a Tag manually:

  1. In the OAS Configure Application, select Configure >> Tags from the top menu.

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

  3. Click on the Add Tag button located at the top of the Tag browser on the left portion of the screen.

  4. A dialog box will appear. Enter a name for your new tag and click ok.
  5. A configuration screen will appear for your new tag. Select OPC in the Data Source dropdown box.

  6. Use the Browse button to the right of the OPC Item to browse OPC Servers for the desired OPC Item.

  7. Select Local, the desired OPC Server, branch within the OPC Server, and OPC Item and click OK.

  8. Specify the desired OPC Update Rate for the Tag.
  9. Click Apply Changes at the bottom right of the window.

To add Tags with One Click OPC:

  1. In the OAS Configure Application, select Configure >> Tags from the top menu.

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

  3. To begin the One Click OPC process select the Group you would like to import to in the Tag configuration. If you want to import to the Root Level, select the Tags Group at the top of the tree.
    Then select the One Click Import button on the top menu bar.

  4. Click on the Import OPC DA 2.XX or 3.0 Items Button in the pop up window.

  5. Use the One Click OPC Wizard to browse for a branch as a starting position within an OPC Server or just select the OPC Server name itself to add all items from the selected OPC Server. For the best networking design select OPC Servers from Local even if you are configuring a remote OAS Service.

  6. Select to enable the options to Get Data Type from OPC Server and optionally the Descriptions.
    Additionally if you want to specify to Trend all of the points select Trend Points.
  7. Click Add Tags and it will automatically add all of the OPC Items from the OPC Server Branch you have selected and all of the sub Branches beneath it.
  8. Select the Save button on the toolbar at the top.

For more detailed instructions on Configuring OPC Server Tags, visit our Getting Started OPC tutorial or the One Click OPC tutorial or watch the video tutorial below:


Step 3. Visualize Your Data with .NET

Project Setup
HMI applications can be developed using Microsoft Visual Studio 2010 (or later). Programming is not required if you use the visual editor.

Open your existing Visual Studio application or start a new one, either VB or C#. Specify WPF App (.NET Framework) as the project type.

Verify that the Target Framework is Version 4.61 or greater.

If you have installed Open Automation Software after installing Visual Studio you should see the Open Automation Software group in your toolbox.  If it is not there you can add a reference in your project to the OPCWPFDashboard.dll.  It will be in your installation folder, most likely: C:\Program Files\Open Automation Software\OAS. Add the tools by right clicking on the toolbox and selecting Choose Items.  In the Choose Toolbox Items dialog box under the WPF tab, select all of the items that start with OPCWPF and say OK.

Add a Viewbox
If you are unfamiliar with the Viewbox control in WPF it is very useful. By setting it’s Stretch property to Uniform, it will automatically transform it’s contents to fit the user’s screen.  It is easier to develop with the Stretch Property set to “None” and then set it back to “Uniform” at the end. You will want your Grid inside of your Viewbox. Your XAML should look like this:

Add a Label Control
Add an OPCWPFLabel control to the window by double clicking on it in the toolbox. Set the Content_Tag property of the label to the Tag property that you want the label to display. Do this by either typing it in the box if you know the name (they are case-sensitive) or use the ellipse next to the property box. If you are using the demo tag configuration that installs with Open Automation Software use Ramp.Value.

Referencing Tags
In the tag browser, you will need to select your network node and then the tag and the property you want to display. Your network node will be the location you have Open Automation Software installed on. If it is your local machine, it will be localhost, otherwise, it could be a registered domain name or an IP address. Here are some examples of referencing tags based on their location:

Local Tag:
myTag.Value

Local Tag in a Group:
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 from Remote OAS Engine
\\192.168.0.1\RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Add a Button Control
Next, add a button to the window by double clicking on OPCWPFButton on the toolbox.  Use the Pump tag for the button, it is a Boolean data type. Set Content_Tag in the properties window to Pump.Value. In the ContentFormatBooleanFalse property enter The Pump is On and the in the ContentFormatBooleanTrue property enter The Pump is Off.  That way the button text will be something more meaningful than simply True or False.

To change the color of the button when it’s value changes, use the Background01_Tag property.  Set it to Pump.Value.  The BackgroundFalse and BackgroundQualityBad properties control the background color for when the value is false and bad quality.

Next, SetValue_Tag property to Pump.Value.  This specifies what value to change when the button is clicked.

Add a Radial Gauge
Drag an OPCWPFRadialGauge onto the screen. Click the ellipse next to the Needles property. This will open the Needles Collection dialog box. Click the Add button.  This adds a Needle to the Radial Gauge. Set the Value_Tag property to Ramp.Value, the Ramp Tag again.  It is a Float Data Type, enter 0 for the ValueFormatFloat property. 

Click F5 to compile and run your project. Your screen should look similar to this.

For more detailed instructions on using OAS with WPF, visit .NET WPF HMI in our knowledge base or watch the video below:

Also, see Getting Started – .NET Trend and Getting Started – .NET Alarm.

How to Visualize OPC UA Data from a WPF .NET Application

How to Visualize OPC UA Data from a WPF .NET Application

Open Automation Software Tags can be defined to connect to OPC UA Servers with the built in OPC UA Driver Interface. This tutorial walks you though downloading and installing OAS, configuring an OPC UA driver, configuring tags and visualizing tag data in .NET WPF with either C# or VB. Programming is not required if you use the designer interface.

Step 1. Download and Install the Open Automation Software and Start the OAS Service

If you have not already done so, you will need to download and install the OAS platform.  Fully functional trial versions of the software are available for Windows, Windows IoT Core, Linux, Raspberry Pi and Docker on our downloads page.

On Windows run the downloaded Setup.exe file to install one or more of the Open Automation Software features. Select the default Typical installation if you are not sure what features to use or the Custom installation if you want to save disk space on the target system.  When prompted agree to the End User License Agreement to continue the installation.

For more detailed instructions and video tutorials, visit the installation guide for your system:
Windows Installation | Linux Installation | Raspberry Pi Installation | Dockers Installation

When the installation is finished the OAS Service Control application will appear.  Use this application to start the 4 Services. If this is the first time installing the software it will automatically enter Runtime with an example Tag Configuration.


Step 2. Configure Your OPC UA Data Source

  1. First, you will need to open the Configure OAS application from the program group Open Automation Software.
  2. Select Configure >> License from the top menu and verify that OPC UA is one of the available Drivers in the lower left of the form. The demo license will have this by default. If you do not see OPC UA available, contact support@openautomationsoftware.com to update your license.
  3. Select Configure >> Drivers from the top menu.

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

  5. The Configure Drivers Screen will appear. Select Siemens from the Driver dropdown box.

  6. Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with a OPC UA Data Source.
  7. Define the properties for the desired physical connection.
  8. Click the Add Driver button above the Driver list in the left pane to add the Driver Interface as an available selection when defining Tags in the next step.

For more detailed instructions on configuring your OPC DA data source, click here to see our Getting Started OPC UA tutorial.


Step 3. Configure Your Tags

OAS provides multiple ways to add and define tags:

To add a Tag manually:

  1. In the OAS Configure Application, select Configure >> Tags from the top menu.

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

  3. Click on the Add Tag button located at the top of the Tag browser on the left portion of the screen.

  4. A dialog box will appear. Enter a name for your new tag and click ok.
  5. A configuration screen will appear for your new tag. Select your data source type in in the Data Source dropdown box.

  6. Specify the correct data type in the Data Type dropdown box.
  7. Click Apply Changes at the bottom right of the window.

For more detailed instructions on configuring your tags, click here to see our Getting Started Tags tutorial.


Step 4. Visualize Your Data with .NET

Project Setup
HMI applications can be developed using Microsoft Visual Studio 2010 (or later). Programming is not required if you use the visual editor.

Open your existing Visual Studio application or start a new one, either VB or C#. Specify WPF App (.NET Framework) as the project type.

Verify that the Target Framework is Version 4.61 or greater.

If you have installed Open Automation Software after installing Visual Studio you should see the Open Automation Software group in your toolbox.  If it is not there you can add a reference in your project to the OPCWPFDashboard.dll.  It will be in your installation folder, most likely: C:\Program Files\Open Automation Software\OAS. Add the tools by right clicking on the toolbox and selecting Choose Items.  In the Choose Toolbox Items dialog box under the WPF tab, select all of the items that start with OPCWPF and say OK.

Add a Viewbox
If you are unfamiliar with the Viewbox control in WPF it is very useful. By setting it’s Stretch property to Uniform, it will automatically transform it’s contents to fit the user’s screen.  It is easier to develop with the Stretch Property set to “None” and then set it back to “Uniform” at the end. You will want your Grid inside of your Viewbox. Your XAML should look like this:

Add a Label Control
Add an OPCWPFLabel control to the window by double clicking on it in the toolbox. Set the Content_Tag property of the label to the Tag property that you want the label to display. Do this by either typing it in the box if you know the name (they are case-sensitive) or use the ellipse next to the property box. If you are using the demo tag configuration that installs with Open Automation Software use Ramp.Value.

Referencing Tags
In the tag browser, you will need to select your network node and then the tag and the property you want to display. Your network node will be the location you have Open Automation Software installed on. If it is your local machine, it will be localhost, otherwise, it could be a registered domain name or an IP address. Here are some examples of referencing tags based on their location:

Local Tag:
myTag.Value

Local Tag in a Group:
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 from Remote OAS Engine
\\192.168.0.1\RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Add a Button Control
Next, add a button to the window by double clicking on OPCWPFButton on the toolbox.  Use the Pump tag for the button, it is a Boolean data type. Set Content_Tag in the properties window to Pump.Value. In the ContentFormatBooleanFalse property enter The Pump is On and the in the ContentFormatBooleanTrue property enter The Pump is Off.  That way the button text will be something more meaningful than simply True or False.

To change the color of the button when it’s value changes, use the Background01_Tag property.  Set it to Pump.Value.  The BackgroundFalse and BackgroundQualityBad properties control the background color for when the value is false and bad quality.

Next, SetValue_Tag property to Pump.Value.  This specifies what value to change when the button is clicked.

Add a Radial Gauge
Drag an OPCWPFRadialGauge onto the screen. Click the ellipse next to the Needles property. This will open the Needles Collection dialog box. Click the Add button.  This adds a Needle to the Radial Gauge. Set the Value_Tag property to Ramp.Value, the Ramp Tag again.  It is a Float Data Type, enter 0 for the ValueFormatFloat property. 

Click F5 to compile and run your project. Your screen should look similar to this.

For more detailed instructions on using OAS with WPF, visit .NET WPF HMI in our knowledge base or watch the video below:

Also, see Getting Started – .NET Trend and Getting Started – .NET Alarm.

How to Visualize MTConnect Data from a WPF .NET Application

How to Visualize MTConnect Data from a WPF .NET Application

Open Automation Software Tags can be defined to connect to MTConnect Servers with the built in MTConnect Driver Interface. This tutorial walks you though downloading and installing OAS, configuring an MTConnect driver, configuring tags and visualizing tag data in .NET WPF with either C# or VB. Programming is not required if you use the designer interface.

Step 1. Download and Install the Open Automation Software and Start the OAS Service

If you have not already done so, you will need to download and install the OAS platform.  Fully functional trial versions of the software are available for Windows, Windows IoT Core, Linux, Raspberry Pi and Docker on our downloads page.

On Windows run the downloaded Setup.exe file to install one or more of the Open Automation Software features. Select the default Typical installation if you are not sure what features to use or the Custom installation if you want to save disk space on the target system.  When prompted agree to the End User License Agreement to continue the installation.

For more detailed instructions and video tutorials, visit the installation guide for your system:
Windows Installation | Linux Installation | Raspberry Pi Installation | Dockers Installation

When the installation is finished the OAS Service Control application will appear.  Use this application to start the 4 Services. If this is the first time installing the software it will automatically enter Runtime with an example Tag Configuration.


Step 2. Configure Your MTConnect Data Source

  1. First, you will need to open the Configure OAS application from the program group Open Automation Software.
  2. Select Configure >> License from the top menu and verify that MTConnect is one of the available Drivers in the lower left of the form. The demo license will have this by default. If you do not see MTConnect available, contact support@openautomationsoftware.com to update your license.
  3. Select Configure >> Drivers from the top menu.

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

  5. The Configure Drivers Screen will appear. Select MTConnect from the Driver dropdown box.

  6. Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with a MTConnect Data Source.
  7. Leave Enable and Add Tags Automatically enabled.
  8. Specify the Live Data Url for the MTConnect stream.
  9. Click the Add Driver button above the Driver list in the left pane to add the Driver Interface as an available selection when defining Tags in the next step.

For more detailed instructions on configuring your MTConnect data source, click here to see our Getting Started MTConnect tutorial or watch the video tutorial below:


Step 3. Configure Your Tags

OAS provides multiple ways to add and define tags:

To add a Tag manually:

  1. In the OAS Configure Application, select Configure >> Tags from the top menu.

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

  3. Click on the Add Tag button located at the top of the Tag browser on the left portion of the screen.

  4. A dialog box will appear. Enter a name for your new tag and click ok.
  5. A configuration screen will appear for your new tag. Select your data source type in in the Data Source dropdown box.

  6. Specify the correct data type in the Data Type dropdown box.
  7. Click Apply Changes at the bottom right of the window.

For more detailed instructions on configuring your tags, click here to see our Getting Started Tags tutorial.


Step 4. Visualize Your Data with .NET

Project Setup
HMI applications can be developed using Microsoft Visual Studio 2010 (or later). Programming is not required if you use the visual editor.

Open your existing Visual Studio application or start a new one, either VB or C#. Specify WPF App (.NET Framework) as the project type.

Verify that the Target Framework is Version 4.61 or greater.

If you have installed Open Automation Software after installing Visual Studio you should see the Open Automation Software group in your toolbox.  If it is not there you can add a reference in your project to the OPCWPFDashboard.dll.  It will be in your installation folder, most likely: C:\Program Files\Open Automation Software\OAS. Add the tools by right clicking on the toolbox and selecting Choose Items.  In the Choose Toolbox Items dialog box under the WPF tab, select all of the items that start with OPCWPF and say OK.

Add a Viewbox
If you are unfamiliar with the Viewbox control in WPF it is very useful. By setting it’s Stretch property to Uniform, it will automatically transform it’s contents to fit the user’s screen.  It is easier to develop with the Stretch Property set to “None” and then set it back to “Uniform” at the end. You will want your Grid inside of your Viewbox. Your XAML should look like this:

Add a Label Control
Add an OPCWPFLabel control to the window by double clicking on it in the toolbox. Set the Content_Tag property of the label to the Tag property that you want the label to display. Do this by either typing it in the box if you know the name (they are case-sensitive) or use the ellipse next to the property box. If you are using the demo tag configuration that installs with Open Automation Software use Ramp.Value.

Referencing Tags
In the tag browser, you will need to select your network node and then the tag and the property you want to display. Your network node will be the location you have Open Automation Software installed on. If it is your local machine, it will be localhost, otherwise, it could be a registered domain name or an IP address. Here are some examples of referencing tags based on their location:

Local Tag:
myTag.Value

Local Tag in a Group:
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 from Remote OAS Engine
\\192.168.0.1\RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Add a Button Control
Next, add a button to the window by double clicking on OPCWPFButton on the toolbox.  Use the Pump tag for the button, it is a Boolean data type. Set Content_Tag in the properties window to Pump.Value. In the ContentFormatBooleanFalse property enter The Pump is On and the in the ContentFormatBooleanTrue property enter The Pump is Off.  That way the button text will be something more meaningful than simply True or False.

To change the color of the button when it’s value changes, use the Background01_Tag property.  Set it to Pump.Value.  The BackgroundFalse and BackgroundQualityBad properties control the background color for when the value is false and bad quality.

Next, SetValue_Tag property to Pump.Value.  This specifies what value to change when the button is clicked.

Add a Radial Gauge
Drag an OPCWPFRadialGauge onto the screen. Click the ellipse next to the Needles property. This will open the Needles Collection dialog box. Click the Add button.  This adds a Needle to the Radial Gauge. Set the Value_Tag property to Ramp.Value, the Ramp Tag again.  It is a Float Data Type, enter 0 for the ValueFormatFloat property. 

Click F5 to compile and run your project. Your screen should look similar to this.

For more detailed instructions on using OAS with WPF, visit .NET WPF HMI in our knowledge base or watch the video below:

Also, see Getting Started – .NET Trend and Getting Started – .NET Alarm.