OPC Historian .NET Server Toolkit Reference
Getting Started
Send comments on this topic.

Glossary Item Box

Following is a step-by-step description of the server development process.

Step Description
  Create the Application Project from a Sample Application

1.1

Copy the sample application directory and rename the copy.

1.2

Open the solution in Visual Studio.
You may change the Solution and Project name but don't change the Name of the HDAPluginNet4.dll base layer customization .NET assembly.
The name of the HDAPluginDBANet4.dll assembly may be changed if the reference in HDAPluginNet4.dll project is adapted.

The name of the generic server (HDANSrv.Net4.exe) can be changed to identify the particular server. The name of the HDANSrv.Net4.exe.config file needs to be renamed too. The RegServer.exe utility registers the server, even with the file name changed.

The .Net assemblies need to be signed with the supplied key files. The bindingRedirect configuration in the application configuration file needs to be adapted if the version number of the assembly is increased. Owner of the code license may recompile the calling assembly instead.

1.3

Search the method GetServerRegistryDef and modify the registration definition.
Each server needs a unique CLSID (Def.ClsidServer) and AppID (Def.ClsidApp). Use the Visual Studio Tool Create GUID and paste the created unique GUID into the code, replacing the existing GUID.

1.4

Select Project - Properties - Configuration Properties - Debugging and change the application path to HDANSrv.Net4.exe in the project debug output directory.

1.5

Compile the project.
With C# this also registers the server and the copied sample application is now accessible under the modified ProgID.
VB does not support post build events and requires the server to be registered manually by executing the RegServer.exe utility in the project output directory.


  Customize and Compile

2.1

Edit the source files:
- AssemblyInfo.cs resp. AssemblyInfo.vb
- ServerAdapt.cs resp. ServerAdapt.vb
- Data*.cs resp. Data*.vb files
- HDANSrv.Net4.exe.config if an application configuration is required. Otherwise this file can be deleted

and add files with additional classes as required for the project specific database handling.
Other classes of the sample server may also need to be adapted for some applications.

2.2

Build the solution and copy additionally necessary files to the output directory.

2.3

Start the project in debug mode and test the device handling.
Use one of the supplied test client or your own client to connect to the already started OPC server.

The clients must use the OPC server ProgID as it is defined in the customization method GetServerRegistryDef() to connect to this server.

2.4

Start an OPC client, connect to the server and check the item address space and the item values.


  Deployment

3.1

Compile the Solution With Release configuration selected.

3.2

Copy the files from the Release Output directory to target computer:
- HDANSrv.Net4.exe
- I_HDAPluginNet4.dll
- HDAPluginNet4.dll
- I_HDAPluginDBANet4.dll
- HDAPluginDBANet4.dll
- HDANSrv.Net4.EXE.CONFIG 
- Regserver.exe
- OPC Core Components.msi from the OPC Core Components subdirectory in the HDANSrv installation directory
  Install the 64 bit version on 64 bit machines !
- perhaps HDATestClientNet4.exe from the BIN subdirectory in the HDANSrv installation directory 
   (to check the installations and diagnose problems)

3.3

Install the common OPC interfaces and the server enumerator.
- 32bit machines:  OPC Core Components Redistributable (x86).msi
- 64bit machines:  OPC Core Components Redistributable (x64).msi
Register the OPC Server on the target computer by executing RegServer.exe in the target directory.


Copyright ©2004-2019 Advosol Inc. All Rights Reserved.