Top Banner
Configuring and Running the OPC .NET Wrapper Server 1
14

Configuring and Running the OPC .NET Wrapper Server

Jan 01, 2016

Download

Documents

hyacinth-patton

Configuring and Running the OPC .NET Wrapper Server. Wrapper Server Software. Standard code for OPC .NET 3.0 Wrappers. Client Interface. Server Interface. Generic Client. Client Base. OPC COM Server. Server Base. OPC Wrapper. WCF. Class API. Class API Client. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Configuring and Running the OPC .NET Wrapper Server

Configuring and Running the OPC .NET Wrapper Server

1

Page 2: Configuring and Running the OPC .NET Wrapper Server

Wrapper Server SoftwareStandard code for

OPC .NET 3.0 Wrappers

Client Interface

Client Base

Server Base

OPC Wrapper

OPC COM Server

Server Interface

WCF

Alternate Server Implementation

Standard code for the client

Standard code for the server

Developer-specific code

ClassAPI

Adhoc Client

Ad-hocAPI

Class API Client

GenericClient

Page 3: Configuring and Running the OPC .NET Wrapper Server

Wrapper Server Overview

3

• Wraps OPC DA, A&E, and/or HDA servers

• Wraps only one server of each type

• Wrapped OPC Classic servers can be local or remote to the Wrapper

• Multiple Wrappers can exist on the same PC at the same time

• Wrappers are located by their URL

Page 4: Configuring and Running the OPC .NET Wrapper Server

Wrapper Server Projects

4

Expand the projects:Console ApplicationWindows Service

Page 5: Configuring and Running the OPC .NET Wrapper Server

Wrapper App.Config

5

Open the App.Config files (they are identical):

Page 6: Configuring and Running the OPC .NET Wrapper Server

Set the Server Info

6

<appSettings><!—Set the name of your company and the name of your server--><add key="Vendor" value="My Company Name"/><add key="Server" value="My Server Name"/><!—Add site specific info (e.g. location of the server). This info is used only for display purposes--><add key="UserInfo" value="Deployment Specific Info"/><!--If the server provides access to a single system only, add this key and the name of the system. The system is the underlying system to which the native Xi server or the wrapped OPC COM server provides access. The system name is used by clients to differentiate Xi InstanceIds obtained from multiple Xi Servers. The SystemName will be embedded in the InstanceIds of this server.--><add key="System" value="This System Name"/>

.

.

Page 7: Configuring and Running the OPC .NET Wrapper Server

Set the Server Info

7

<appSettings><!—Set the name of your company and the name of your server--><add key="Vendor" value="My Company Name"/><add key="Server" value="My Server Name"/>

<!—Add site specific info (e.g. location of the server). This info is used only for display purposes--><add key="UserInfo" value="Deployment Specific Info"/>

Page 8: Configuring and Running the OPC .NET Wrapper Server

Set the System Name

8

<appSettings>…<!--If the server provides access to a single system only, add this key and the name of the system. Otherwise, comment out this entry. The system is the underlying system to which the native Xi server or the wrapped OPC COM server provides access. The system name is used by clients to differentiate Xi InstanceIds obtained from multiple Xi Servers. The system name will be embedded in the InstanceIds of this server.--><add key="System" value="This System Name"/>

Page 9: Configuring and Running the OPC .NET Wrapper Server

Set the ProgIds of the wrapped OPC Classic servers

9

<appSettings>

<!--The following keys contain the ProgIds for the wrapped servers-->

<add key="OPCDA" value="OPC DA ProgId"/>

<add key="OPCAE" value="OPC AE ProgId"/>

<add key="OPCHDA" value="OPC HDA ProgId"/>

Page 10: Configuring and Running the OPC .NET Wrapper Server

Set the MachineName of the wrapped OPC Classic servers

10

<appSettings>…

<!--The following keys contain the Machine Names/IP Addresses for the wrapped servers. Leave them commented out if they are on the same machine as the Wrapper-->

<!--<add key="OPCDAHOST" value =“MachineName"/>--><!--<add key="OPCAEHOST" value =“MachineName"/>--><!--<add key="OPCHDAHOST" value =" MachineName "/>-->

Page 11: Configuring and Running the OPC .NET Wrapper Server

Set the Base Addresses

11

<system.serviceModel>…

<host><baseAddresses>

<!--Change the default “XiServices” and the Port Numbers (60080 and 60081) in the following three lines to your own values only if multiple OPC .NET 3.0 servers will be on the same machine-->

<add baseAddress="net.pipe://localhost/XiServices" /><add baseAddress="http://localhost:60080/XiServices" /><add baseAddress="net.tcp://localhost:60081/XiServices" />

Page 12: Configuring and Running the OPC .NET Wrapper Server

Running the Console App

12

• Build the Wrapper Server ConsoleApp project

• The App.config file will be compiled and copied to the bin directory with the executable

• Run the Wrapper Server ConsoleApp using the debugger, or run the executable from either:– Xi Projects\x86\Debug\bin– Xi Projects\x86\Release\bin

Page 13: Configuring and Running the OPC .NET Wrapper Server

Installing the Windows Service

13

• Build the Wrapper WinService project • The App.config file will be compiled and copied

to the bin directory with the executable• Install the Wrapper Server WinService by

opening a DOS Command window and typing the executable name followed by /Install– See Main() in XiOPCwWinSvrProgram.cs for more

options• In Control Panel/Administrative

Tools/Services set the Properties for the Xi Server service as desired (e.g. the Logon account/password)

Page 14: Configuring and Running the OPC .NET Wrapper Server

Running the Windows Service

14

• Run the Wrapper Server using:– Control Panel/Administrative Tools/Services– Start the Xi Discovery Service

• If using a debug build, debug by attaching the Debugger to the Xi Server process