.NET Based OPC UA Client/Server SDK
3.3.0.530
|
Create a new C#
project of typ Windows Form App (.NET Framework)
with the target framework .NET Framework 4.5
.
We start our UA-Client aka Form1
at another position. Therefore, delete the marked line from the file Program.cs
.
To setup the OPC UA .Net SDK Nuget Package Repository
D:\UnifiedAutomation\UaSdkNetBundleBinary\NuGetPackages
by default.To install Nuget packages in your project
Don't forgett to add the using for UaBase
at the end of the using-block in Program.cs.
At first add a new folder in your solution named License
.
Normaly you would use your purchased license file, but for evaluation and for this example you can take the license from our code samples located by default in D:\UnifiedAutomation\UaSdkNetBundleBinary\src\examples\UaBasicClient\License
.
To see the license file set the filter to All Files (*.*)
, select the license file and confirm with clicking the button Add
.
The license file will be copied to your project's license folder.
To finish the task you have to set the BuildAction of the license file to Embedded Resource
.
To use the license, you must add it to the LicenseManager. Therefore, add the following code in main()
in Program.cs
.
To configure your client you have to provide a configuration file. Add an App.config
file from an example project to your project. Same procedure as with the license file above. You can take it e.g. from D:\UnifiedAutomation\UaSdkNetBundleBinary\examples\BasicClient
.
For more information on configuration settings, see the Base Library documentation at Configuration Schema.
Finally, you must set the BuildAction of the file to None
.
To finish this example and make your client start, add the following method to Program.cs
, where Form1
is the automatically created form when creating the new project.
Now add the following code to the main method whicht calls to start ApplicationInstance