DANSrv Reference
Getting Started
Send comments on this topic.
DANSrv OPC DA .Net Server Toolkit > Getting Started

Glossary Item Box

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

Step Description
 
Create Application Project using the Wizard


A1.1

Start Visual Studio (version 2008 or newer)

Note: If VS was open during DANSrv setup then you may need to restart VS for the newly installed project templates to be recognized.

A1.2 Select File - New - Project - Compiler ( VB or C# )

A1.3 Select the Advosol\DANSrv Template

A1.4 Enter Project Name and Location and click OK

A1.5 In the wizard configuration dialog define:
- Vendor Id
- Server Name
- Update rate
- Branch Separator Character
- Browse Mode
- Item Validate Mode
- Sample Code yes/no
- Custom Item Properties sample code
- ConfigBuilder sample code
- Server ProgId
- ProgId of the current server version
- Friendly name of the OPC server
- Friendly name of the current version of the OPC server

A1.6 Click Finish
The Visual Studio Solution is created according the selections.


  Create the Application Project from a Sample Application

B1.1 Copy the sample application directory and rename the copy.

B1.2 Open the solution in Visual Studio and open the file ServerAdapt.cs respectively ServerAdapt.vb.
You may change the Solution and Project name but don't change the Assembly Name (NSPlugin.dll).
We recommend not to change the name of the generic server (DANSrv.exe) because this would require batch file changes.

B1.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.

B1.4 Select Project - Properties - Configuration Properties - Debugging and change the application path to DANSrv.exe in the project debug output directory.

B1.5 Compile the project.
The post build step registers the server and the copied sample application is now accessible under the modified ProgID.



  Customize and Compile

2.1

 

Edit the generated source files:
- AssemblyInfo.cs resp. AssemblyInfo.vb
- ServerAdapt.cs resp. ServerAdapt.vb
- DANSrv.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 device handling.
Build the application project and correct all compile errors.

2.2 Build the project.
The post build step copies the generic server DANSrv.exe and RegServer.exe into the project output directory and registers the server.

2.3

 

Start the project in debug mode and test the device handling.
Use one of the supplied test clients 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:
- DANSrv.EXE
- NSPlugin.DLL
- DANSrv.EXE.CONFIG ( if required )
- RegServer.exe
- OPC Core Components (32bit or 64bit) from the OPC subdirectory in the DANSrv installation directory
- perhaps OPCDATestClient.exe from the BIN subdirectory in the DANSrv installation directory (to check the installations and diagnose problems)

3.3

 

The OPC Core Components are required for the DCOM server access to work.
On 64bit machine the 64bit OPC Core Components should be installed. They support 64bit and 32bit operation and are necessary if either the server or a client run in 64bit mode.
The OPC Core Components setup files are included in the OPCDA.NET distribution. See Deployment for details.

© 2002-2017 Copyright Advosol Inc. All Rights Reserved.