AE features are implemented in NSPlugin.dll as an extension of the DA features. First create a NSPlugin.dll implementation as explains in chapter Server With DA Functionality and the add the AE functionality according AE Plug-in Development Steps. uaPLUS uses the same plug-in DLL interface as the Advosol DANSrvAE OPC DA/AE .NET Server toolkit. |
![]() |
The OPC DA and UA specifications define data management features that are application independent. The DANSrv DA server toolkit and the uaPLUS UA server toolkit implement these data management features in the generic server and define a rather simple interface to NSPlugin.dll. The user only has to implement this interface to provide the application specific device access.
The OPC AE specification is different. Most features depend more or less on the kind of events that are to be handled. Therefore, the generic AE server contains less functionality than the generic DA server. Most functionality is in the plug-in DLL. For this reason the AE handler is split into two layers:
- Device Layer
Contains the definition of the alarm/event types and conditions the server uses. Device signals are supervised and on changes the appropriate event is created.
This layer is implemented in classes in the NSPlugin namespace (as the DA device handler)
- EventServer class implements the methods specified in the OPC AE OPCEventServer interface
- EventAreaBrowser class implements the methods specified in the OPC AE OPCEventAreaBrowser interface
- EventSubsrcription class implements the methods specified in the OPC AE OPCEventSubsrcription interface
- EventArea class handles the areas/sources
- EventCondition class handles condition changes
- Base Layer
Processes the events and notifies the subscribed clients according the OPC AE specification.
In some cases application specific changes or optimizations may be required.
The source code of the AE Base Layer is provided with the uaPLUS AE license.
The executable is provided in the NSPluginAEBase.Net4.dll
Depending on the implementation of the AE Device Layer the Base Layer code can be:
- in the NSPlugin DLL, together with the Device Layer code
- in a separate DLL, as the provided NSPluginAEBase.Net4.dll
- within uaPLUS generic server. If no application specific changes are required in the Base Layer code,
then the uaPLUS embedded code can be used to simplify the server.
The provided AE handler sample implementation:
- tries to load NSPluginAEBase.Net4.dll and uses it if found.
- otherwise, it uses the uaPLUS internal AE base
The AE handler implements a .NET interface according the Classic OPC AE specification. To make it usable with UA, the uaPLUS UA server implements a UA to COM wrapper server. The UA specification part 9, Annex D specifies guidelines for the wrapper implementation.
UA Mapping
The AE areas and sources managed by the plug-in are mapped to UA objects.
The NSPlugin.dll AE part is represented as the root object with the default name AEplugin
The name can be changed with a definition in the AppSettings section of the application configuration file (uaPLUS.Net4.exe.config)
<add key="AErootName" value="myName"/>
The AE area structure is mirrored under this UA object.
Servers with an application specific main program can instead define the root name in the static property uaPLUS.aeRootName
The plug-in for UA servers with DA and AE functionality can be developed:
- Based on one of the provided sample servers.
- By extending an existing DA server by copying the AE related classes and methods from the DA-AE sample servers.
The NSPlugin assembly for DA and AE must implement the following event server related classes in addition to the DA functionality.
- EventServer
- EventAreas
- EventSubscription
- EventCondition
To add AE functionality to an existing DA server project do:
- In the ServerAdapt.cs/vb code of the provided AE sample servers locate the code sections that are marked with:
//------------ A&E Support
and copy the code to the ServerAdapt.cs/vbn code of the DA server. - Add the files:
- EventServer.cs/vb
- EventArea.cs/vb
- EventSubscripton.cs/vb
- EventCondition.cs/vb
from the AE sample server to the DA server project.
Note: The two provided AE sample servers differ in how the DA items and the event sources are defined. Use the sample server that best matches your DA server.
Class members declared as public may NOT be modified. These are used by the generic server and any change would require an adaptation of the generic server. The public defined member are not application specific and there is actually no need for changes except for supporting new specification versions that may be released in the future.