.NET Programmatic Server Configuration
Programmatic setup of OAS configuration is supported with the methods in the assembly OASConfig.dll which is a .NET Standard 2.0 assembly. It can be used in applications that 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 184.108.40.20699 or greater
The same methods are also included in the legacy OPCSystems.dll assembly for .NET Framework 4.6 or less.
The most commonly used methods are Get and Set Tag Properties to obtain and set desired properties of multiple tags in one call.
All configurations can be programmatically defined. This would include Tags, Data Logging, Alarm Logging, Alarm Notification, Recipes, Security, and Options.
Refer to the OAS Example Service Code for a working example of programmatically adding tags to a service. This includes example projects for both C# and VB for .NET Core Console App to run on all operating systems including Linux, Windows, Mac, Android, and iOS. There is also C# and VB projects to run as a Windows Service. The code examples in all 4 projects are the same to show adding tags programmatically and the asynchronous and synchronous methods for reading and writing data.
See our OASConfig documentation for more details.
See Automatic Configuration with Dynamic User Interface to view WPF application that creates tags and adapts the user interface based on the configuration defined.