FAQs – .NET WinForm HMI

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.
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 5 or greater
  • .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\
 
Can WinForm applications be deployed to remote systems for Internet communications?
Yes, applications communicate using WCF over a standard TCP port which is adjustable. The default port number is 58724. View the Networking – LAN, WAN, and Internet Videos on how to implement standard communications over the Internet and also the Live Data Cloud networking on how to host your own data without a fixed IP address or registered domain name.
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 OPCControls components, 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\.
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\.
.
What assemblies do I need to deploy with my application?
Include the following in References as Local Copy:
  • OPCControls.dll
  • OPCSystemsInterface.dll

Videos – .NET WinForm HMI

WinForm HMI

Create WinForm Windows desktop applications with real-time visualization.

WinForm HMI .NET

User Interface controls for WinForm application development to deploy locally and remotely as a 100% managed application.

WinForm HMI

How to create classic WinForm HMI applications using OPCWindowsHMI.NET.

  • 00:00 – Introduction
  • 00:10 – How to Create an HMI Presentation using OPC Controls.NET
  • 00:30 – How to Use the Controls without Writing any Code
  • 00:36 – Create a Winform Application
  • 01:11 – Select OPC Controls Components
  • 01:33 – Label Control
  • 01:47 – Network Node
  • 02:21 – Set the Formatting
  • 02:32 – OPC Controls Button
  • 02:40 – Set the Color of the Button
  • 02:47 – Set the Pump Value
  • 03:20 – Test the Application
  • 03:47 – More Questions

WinForm Gauges

How to add a realtime gauge control to a WinForm HMI application.

WinForm MDI Template

How to use the Multi Document Interface template for creating simple WinForm applications.

WinForm Tabbed Template

How to use the WinForm Tabbed Template to create simple WinForm applications.

Videos – OAS WinForm Gauge .NET

View the following video for WPF gauges included with OAS WPF HMI .NET and OAS WinForm HMI .NET for WinForm applications.

Radial Gauge Demo

Demonstration of WPF Radial Gauge controls in action.

WPF Radial Gauge

How to integrate the radial gauge control into a WPF dashboard application.

WPF Linear Gauge

How to integrate the linear gauge control into a WPF dashboard application.

WinForm Gauges

How to add a realtime gauge control to a WinForm HMI application.

  • 00:00 – Introduction
  • 00:10 – How to Implement OPC Gauge .NET
  • 00:25 – Microsoft Visual Studio/New Project
  • 01:26 – Add a Component
  • 01:40 – Properties
  • 02:05 – Network Node
  • 02:52 – Debug Mode
  • 03:11 – Properties of the Needle
  • 05:29 – Define the Value
  • 05:41 – Run the Application
  • 06:06 – Set the Scale
  • 06:29 – Visible Properties
  • 06:38 – Angles
  • 07:16 – Change Font and Color
  • 07:27 – Display Axis
  • 07:52 – Background Color
  • 08:24 – Gauge Size
  • 08:37 – Straight Gauge
  • 08:43 – OPC Gauge Login Component
  • 09:02 – OPC Gauge Network Node Component
  • 09:21 – View the Example Application
  • 09:30 – Select Gauges
  • 09:39 – Gauges Demostration
  • 10:07 – Download Open Automation Software

OAS WinForm Gauge .NET

The OAS WinForm Gauge .NET product provides circular and linear gauges for Windows WinForm applications. Gauges are included at no cost in the OAS WPF HMI .NET product for Windows Presentation Foundation applications.

  • 00:00 – Introduction
  • 00:10 – How to Implement OPC Gauge .NET
  • 00:25 – Microsoft Visual Studio/New Project
  • 01:26 – Add a Component
  • 01:40 – Properties
  • 02:05 – Network Node
  • 02:52 – Debug Mode
  • 03:11 – Properties of the Needle
  • 05:29 – Define the Value
  • 05:41 – Run the Application
  • 06:06 – Set the Scale
  • 06:29 – Visible Properties
  • 06:38 – Angles
  • 07:16 – Change Font and Color
  • 07:27 – Display Axis
  • 07:52 – Background Color
  • 08:24 – Gauge Size
  • 08:37 – Straight Gauge
  • 08:43 – OPC Gauge Login Component
  • 09:02 – OPC Gauge Network Node Component
  • 09:21 – View the Example Application
  • 09:30 – Select Gauges
  • 09:39 – Gauges Demostration
  • 10:07 – Download Open Automation Software

The product includes the Windows Services to read and write OPC Items and Tag Parameters and process data to unlimited local and remote applications developed with the OPC Controls components.

Applications can be developed using Microsoft Visual Studio 2005, 2008, or 2010 with no programming required.

Applications developed with OAS WinForm Gauge .NET can run locally and remotely.

For step by step instructions of using OAS WinForm Gauge .NET review the Getting Started-HMI-Windows Gauges section or view the following video presentation

OPC Controls.NET Runtime Distribution

You can distribute all OPC Controls .NET components with your local and remote applications. These components will only connect to licensed OAS Services.

Include in the Project Referencers all .dlls files located in C:\Program Files\Open Automation Software\OAS\Controls\NetFramework\OPCControls.

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

OPC Controls Data

The OPCControlsData component is used to read and write values to Open Automation Software Tag Parameters.

Reading and writing to both local and remote OAS Service Tags simplifies the task of reading and writing live data from each OAS data source.

If a Tag Parameter Source is defined other than Value or Calculation when a value is written to the value of the parameter the value is written to the data source defined.

View the .NET Realtime Data Access section in Programmatic Interface topic for examples of reading and writing data.

OPC Controls Data 354

To add an OPC Controls Data component select the OPCControlsData component from the ToolBox and place it on any Windows Form of your choice.  Add OPC Controls Components to Visual Studio.NET to add the OPC Controls Data component to the ToolBox.

OPC Controls Read Values

Refer to the Read Data Continuously example code for a full example on how to read data from Open Automation Software Tags.

To read values from the Open Automation Software involves one simple method to let the OAS Services which Tags you wish to read and one simple event receive all changes and updates to the Tags you wish to read.

Use the AddTag or AddTags as many times as you desire to subscribe to both local and remote OAS Services.

Dim Tags(2) As String
        Tags(0) = "Ramp.Value"
        Tags(1) = "Sine.Value"
        Tags(2) = "Random.Value"
        OpcControlsData.AddTags(Tags)

Use the ValuesChangedAll Event to receive the requested values continuously any time the values are requested or the values change.

Private Sub OpcControlsData_ValuesChangedAll(ByVal Tags() As String, ByVal Values() As Object, ByVal Qualities() As Boolean, ByVal TimeStamps() As Date) Handles OpcControlsData.ValuesChangedAll

Use the RemoveTag or RemoveTags as many times as you desire to unsubscribe to both local and remote OAS Services.

Dim Tags(2) As String
        Tags(0) = "Ramp.Value"
        Tags(1) = "Sine.Value"
        Tags(2) = "Random.Value"
        OpcControlsData.RemoveTags(Tags)

OPC Controls Write Values

Refer to the Write Data example code for a full example on how to write data to Open Automation Software.

To write values from the Open Automation Software involves one simple method to write the values, one simple method to let the OAS Services which Tags you wish to read to confirm the value was successful, and one simple event receive all changes and updates to the Tags you wish to read.

Use the WriteTag or WriteTags to send the desired values to the tags.

OpcControlsData.WriteTag("Write OPC Output.Value", 1.23)

OPC Controls StatusBar

The OPC Controls StatusBar component performs exactly like the standard StatusBar component with additional properties to automatically update from any Open Automation Software Tag Parameter. For programmatic help refer to the OPCControls Help file.

OPC Controls StatusBar 353

To add an OPC Controls StatusBar select the OPCControlsStatusBar component from the ToolBox and place it on any Windows Form of your choice. See Add OPC Controls Components to Visual Studio.NET to add the OPC Controls StatusBar to the ToolBox.

OPC Controls StatusBar Properties

Refer to OPCControls help for all properties and members of the OPC Controls.NET components. All properties can be assigned in code; however no programming is required to use the properties.

The following properties can automatically be set by Open Automation Software Tag values.

Enabled

OPC Controls Label Properties 311

Location

OPC Controls Label Properties 314

Size

OPC Controls Label Properties 315

Tag

OPC Controls Label Properties 316

Text

OPC Controls Label Properties 317

Visible

OPC Controls Label Properties 318

OPC Controls TrackBar

The OPC Controls TrackBar component performs exactly like the standard TrackBar component with additional properties to automatically update from any Open Automation Software Tag Parameter. For programmatic help refer to the OPCControls Help file.

OPC Controls TrackBar 351

To add an OPC Controls TrackBar select the OPCControlsTrackBar component from the ToolBox and place it on any Windows Form of your choice. Add OPC Controls Components to Visual Studio.NET to add the OPC Controls TrackBar to the ToolBox.

OPC Controls TrackBar Properties

Refer to OPCControls help for all properties and members of the OPC Controls.NET components. All properties can be assigned in code; however no programming is required to use the properties.

Use the ValueOPCSystemsSetValue property to enable the ability to write to a Tag Parameter when the Mouse moves the TrackBar Value.  If the Tag Parameter is assigned to an OPC Item as a source the OPC Item will be written to with the value specified when the Mouse moves the OPC Controls TrackBar Value.

The following properties can automatically be set by Open Automation Software Tag values.

BackColor

OPC Controls Button Properties 320

Enabled

OPC Controls Button Properties 321

Location

OPC Controls Button Properties 324

Maximum

OPC Controls HScrollBar Properties 347

Minimum

OPC Controls HScrollBar Properties 348

Size

OPC Controls Button Properties 326

Tag

OPC Controls Button Properties 327

Text

OPC Controls PictureBox Properties 339

Value

OPC Controls TrackBar Properties 352

Visible

OPC Controls Button Properties 329

OPC Controls VScrollBar

The OPC Controls VScrollBar component performs exactly like the standard VScrollBar component with additional properties to automatically update from any Open Automation Software Tag Parameter.  For programmatic help refer to the OPCControls Help file.

OPC Controls VScrollBar 350

To add an OPC Controls VScrollBar select the OPCControlsVScrollBar component from the ToolBox and place it on any Windows Form of your choice. Add OPC Controls Components to Visual Studio.NET to add the OPC Controls VScrollBar to the ToolBox.

OPC Controls VScrollBar Properties

Refer to OPCControls help for all properties and members of the OPC Controls.NET components. All properties can be assigned in code; however no programming is required to use the properties.

Use the ValueOPCSystemsSetValue property to enable the ability to write to a Tag Parameter when the VScrollBar is scrolled. If the Tag Parameter is assigned to an OPC Item as a source the OPC Item will be written to with the value specified when the OPC Controls VScrollBar is scrolled.

The following properties can automatically be set by Open Automation Software Tag values.

Enabled

OPC Controls Button Properties 321

Location

OPC Controls Button Properties 324

Maximum

OPC Controls HScrollBar Properties 347

Minimum

OPC Controls HScrollBar Properties 348

Size

OPC Controls Button Properties 326

Tag

OPC Controls Button Properties 327

Text

OPC Controls PictureBox Properties 339

Value

OPC Controls HScrollBar Properties 349

Visible

OPC Controls Button Properties 329