Overview – Programmatic Interface

There are five different methods of interfacing with the Programmatic Interfaces of the OAS server, each targeted at a specific set of needs.

.NET Configuration for all platforms

The free to use .NET Standard 2.0 OASConfig assembly is used to programmatically add and update all OAS Engine configurations and can target .NET 7, 6, 5, .NET Core 2.0 or greater, .NET Framework 4.61 or greater, Xamarin.iOS 10.14, Xamarin.Android 8.0, and UWP 1.0.0.16299.

.NET Data Connector for all platforms

The .NET Standard 2.0 OASData assembly is used to provide read and write access to OAS tag variables and can target .NET 7, 6, 5, .NET Core 2.0 or greater, .NET Framework 4.61 or greater, Xamarin.iOS 10.14, Xamarin.Android 8.0, and UWP 1.0.0.16299.

.NET Connector and Windows Components

For .NET developers who wish to create HMIs or system automations on a windows platform, these components provide visual and programmatic access to real time and historical data, as well as interfaces into automated configuration of the OAS server.

.NET Core for Native Mobile Applications

The .NET Core Components are a programmatic interface designed to be used in a Xamarin Application, which allows developers to compile native applications for iOS and Android devices with a single code base.

Universal Driver Interface

Create data sources for OAS with target to both .NET Standard 2.0 for cross platform deployment and .NET Framework 4.6.1 or greater and .NET Framework 4.6 or less to deploy Windows Services locally and remotely.
Define your own properties that are automatically added to the OAS engine.
See the UDI Technical Overview on how to create a Universal Driver.

REST API

Using standard REST patterns and JSON over HTTP, the REST API provides a programmatic interface for any platform that supports those technologies, including Linux servers, RaspberryPI and Arduino devices, and more.

Web HMI

For developers interested in creating HMIs in HTML5 web applications, the OAS Web HMI includes libraries for displaying real time and historical data in any web browser, using both a markup technique as well as a programmatic Javascript API.

The following graphic shows how Open Automation Software provides programmatic access for real time and historical data and shows the protocols and tools to create specific applications.

For more details on how to use any of these interfaces, see below:

FAQs – .NET Data Connector

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\
 
Is there example code of the .NET Data Connector?

Yes, refer to the OAS Example Service Code for working code examples if both C# and Visual Basic.

What assemblies do I need to deploy with my application?
Include OASData.dll as Local Copy reference to target the following.
  • .NET 5
  • .NET Core 2.o 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
For .NET Framework 4.6 or less include OPCSystemsDataConnector.dll.

Videos – .NET Data Connector

Refer to the following video on how to programmatically access data from the Open Automation Software real-time data service and directly from OPC Servers using DirectOPC.

.NET Data Connector

Connect Visual Studio applications to interface with Industry 4.0 data and share data to IIoT applications on-premise or over the Internet.

Real-time Data Access .NET Applications

How to make any .NET application a live data source to all products.  Also how to share data from any data source to .NET applications.

View the following networking videos for syntax on how to enable remote communications.

Easy Networking

How to network all products to central service using a fixed IP Address or registered domain name for the Internet.

Live Data Cloud

How to host data from any Windows PC with a standard Internet connection.  No fixed IP Address or registered domain name required.

.NET Data Connector

To access data from the Open Automation Software real-time data service you can use the OPCSystemsDataConnector component in the OPCSystemsDataConnector.dll.

Refer to the .NET Realtime Data Access section for full syntax examples.

Refer to the Forms FormReadValues and FormWriteValues in the WinForm Example Source Code installed with Open Automation Software for a documented working example of the data component.

With the release of the OAS Platform v12, the .NET Data Connector is based on .NET Standard 2.0. This allows you to read and write OAS data from an application that can be deployed to any supported OS, including Linux, Mac, Android, and iOS.

Videos – Data Sources

Data Sources

Overview of the most common data sources for Open Automation Software.

OPC Servers

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

.NET Applications

How to make any .NET application a live data source to all products.  Also how to share data from any data source to .NET applications.

Databases

How to setup continuous and event data transfer from SQL Server, Oracle, Access, and mySQL for any SCADA and HMI product.

Microsoft Excel

How to connect Microsoft Excel to any data source and share data with any product with local and remote Excel Workbooks.

OPC Clients

How to connect third party OPC Clients for both local and Internet connections.

Calculations

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

OPC Server to OPC Server

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

Frequently Asked Questions – Recipe

MS Access Error microsoft.ace.oledb.12.0 provider is not registered
MS Access Class not Registered System Error

For Office 2010, the following update will correct this issue.

https://www.microsoft.com/en-us/download/details.aspx?id=39664

For Office 365 (please note, by default Office365 installs the 32-bit version regardless of your system), use:

https://www.microsoft.com/en-us/download/details.aspx?id=54920

If my Recipe is not working how can I find the solution?
Go to Configure-Options-System Logging. Enable the Recipe Transaction Log and the details of each recipe execution will be logged within the file.
How can I return aggregate results of the last 24 hours of a database table?
Set the field names to use your desired aggregate functionsExample: AVG(myField), MIN(myField), MAX(myField), and SUM(myField). In the Query String property enter the following: WHERE DateAndTime <= CURRENT_TIMESTAMP AND DateAndTime > DATEADD(hh,-24,CURRENT_TIMESTAMP)

Videos – Recipe

Recipe – Database Connector

Transfer data from SQL Server, Oracle, Access, MySQL, Azure SQL, PostgreSQL, Cassandra, MongoDB, MariaDB, and SQLite to Industry 4.0 data and IIoT application.

Recipe Setup

How to transfer data from a database to a PLC or OPC server.

Recipes Programmatic Interface

Use the OPC Systems component in your Visual Studio application to programmatically modify recipe groups. Refer to the FormConfigureRecipes Form in the WinForm Example Code example for an example and how to add and modify recipe groups.

Refer to the Programmatic Access Recipe Groups|topic=Programmatic Access Recipe Groups section in the Programmatic Interface – .NET Programmatic Configuration topic for all of the method syntax.

Recipes CSV Export and Import

All recipe groups can be exported to a CSV file by right clicking on the Local service and select Export CSV.

Note: You cannot have Excel open with the CSV file during the import as Excel will lock the file for exclusive use. First close the file in Excel, and then proceed with the import.