110 likes | 218 Views
Configuring and Running the OPC .NET Discovery Server. Discovery Server Overview. Finds Xi Servers cyclically using PNRP and/or a Manual Configuration File Location and name of the Manual Configuration File are configured in the app.config file of the Discovery Server
E N D
Discovery Server Overview • Finds Xi Servers cyclically using PNRP and/or a Manual Configuration File • Location and name of the Manual Configuration File are configured in the app.config file of the Discovery Server • Accesses Xi Servers that it finds and retrieves their ServerEntry • ServerEntry contains the ServerDescription and Binding information not contained in the WSDL • Provides a method called by Xi Clients to obtain the list of ServerEntries
Discovery Server Software Standard code for Discovery Servers Client Interface Server Interface Server Base Discovery Server Client Base WCF Client App OPC COM Server OPC Wrapper Alternate Server Implementation Developer-specific code Standard code for the client Standard code for all servers Developer-specific code
Discovery Server Projects • Open either project: • Console Application • Windows Service
Discovery Server App.Config Open and edit both App.Config files (they are identical)
<appSettings> <appSettings> <addkey="Vendor" value="MyCompany"/> <addkey="Server" value="Xi Server Discovery Server"/> <!--The next two entries are used to define the path to the manual configuration file that contains a list of IP Addresses/Port Numbers of Xi Servers.--> <!--Note that the path may contain Windows environment variables enclosed in '%'.--> <addkey="ServerAddressFilePath" value ="%ALLUSERSPROFILE%\OPC Xi\"/> <addkey="ServerAddressFileName" value="XiServerAddresses.txt"/> </appSettings> . .
Set the Manual Config File Path • Set the value of this key to the path to your manual configuration file if you don’t like the default <addkey="ServerAddressFilePath" value ="%ALLUSERSPROFILE%\OPC Xi\"/> ALLUSERSPROFILE is a built-in Windows environment variable. The DOS “SET” cmd will provide its value.
Set the Manual Config File Name • Set the value of this key to the name of your manual configuration file if you don’t want to use this one. • <addkey="ServerAddressFileName" • value="XiServerAddresses.txt"/> • Note: You might have multiple Manual Config Files from which to select before you start your Discovery server.
Running the Console App • Build the Discovery Server ConsoleApp project • The App.config file will be compiled and copied to the bin directory with the executable • Run the Discovery Server ConsoleAppusing the debugger, or run the executable from either: • Xi Projects\x86\Debug\bin • Xi Projects\x86\Release\bin
Installing the Windows Service • Build the Discovery Server WinService project • The App.config file will be compiled and copied to the bin directory with the executable • Install the Discovery Server WinService by opening a DOS Command window and typing the executable name followed by /Install • See Main() in XiDiscoveryWinSvrProgram.cs for more options • In Control Panel/Administrative Tools/Services set the Properties for the Xi Discovery Server service as desired (e.g. the Logon account/password)
Running the Windows Service • Run the Discovery Server using: • Control Panel/Administrative Tools/Services • Start the Xi Discovery Service • If using a debug build, debug by attaching the Debugger to the Discovery Server process