Configuring and Running the OPC .NET Wrapper Server
-
Upload
hyacinth-patton -
Category
Documents
-
view
57 -
download
10
description
Transcript of Configuring and Running the OPC .NET Wrapper Server
Configuring and Running the OPC .NET Wrapper Server
1
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
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
Wrapper Server Projects
4
Expand the projects:Console ApplicationWindows Service
Wrapper App.Config
5
Open the App.Config files (they are identical):
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"/>
.
.
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"/>
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"/>
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"/>
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 "/>-->
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" />
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
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)
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