This method is called from the generic server at startup, when the first client connects.
It defines the application specific server parameters and operating modes.
The default implementation in IGeneric.cs initializes default values and tries to read the configuration definitions from the file DANSrv.exe.config respectively web.config for XML DA servers.
The default method can be replaced by defining a method overload in ServerAdapt.cs. The definitions can be made in the code to protect them from being changed without a recompilation.
Visual Basic (Declaration) | |
---|---|
Public Function GetServerParameters( _ ByRef UpdatePeriod As Integer, _ ByRef BrowseMode As Integer, _ ByRef validateMode As Integer, _ ByRef BranchDelemitter As Char _ ) As Integer |
C# | |
---|---|
public int GetServerParameters( out int UpdatePeriod, out int BrowseMode, out int validateMode, out char BranchDelemitter ) |
Parameters
- UpdatePeriod
- This interval in ms is used by the generic server as the fastest possible client update rate and also uses this definition when determining the refresh need if no client defined a sampling rate for the item.
The default value is as defined in the wizard dialog. In the DANSrv.exe.config the value is defined as:
<add key="UpdatePeriod" value = "100" /> - BrowseMode
Defines how client browse calls are handled.
0 (real mode) : all browse calls are handled in the generic server according the items defined in the server cache.
2 (virtual mode) : all client browse calls are handled in this plug-in and typically return the items that are or could be dynamically added to the server cache.
Only the DANSrv/XDARap Professional Edition supports virtual mode browsing. The Standard Edition ignores this parameter.The default value is as defined in the wizard dialog. In the file DANSrv.exe.config respectively web.config the value is defined as:
<add key="BrowseMode" value = "REAL" /> <!-- REAL or VIRTUAL -->- validateMode
This parameter controls how the generic server handles the ValidateItems client calls.
0 : The plug-in ValidateItems method is called for items that are not found in the generic server cache.
1 : The plug-in ValidateItems method is NEVER called. Requested items that are not defined in the generic server cache are treated as unknown items.
2 : The plug-in ValidateItems method is ALWAYS called. This allows the plug-in to determine the items access rights based on the client's credentials and return OPC_E_UNKNOWNITEMID for clients without the required privileges.Only the DANSrv Professional Edition supports item validation and a dynamic address space. The DANSrv Standard Edition ignores this parameter.
The default value is as defined in the wizard dialog. In the file DANSrv.exe.config respectively web.config the value is defined as:
<add key="ValidateMode" value= "NEVER" /> <!-- NEVER, UNKNOWNITEMS or ALWAYS -->- BranchDelemitter
Character is used as the branch/item separator character in fully qualified item names. It is typically '.' or '/'.
This character must match the character used in the fully qualified item IDs specified in the AddItems method call.The default value is as defined in the wizard dialog. In the file DANSrv.exe.config respectively web.config the value is defined as:
<add key="BranchDelemitter" value= "." />
Return Value
Always returns S_OKThe DANSrv/XDARap project generation wizards create a configuration file with the definitions as specified in the wizard dialog. The default values in the code are the same.
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7, Windows Server 2008 family