Optional method. Called from DANSrv/XDARap Professional Edition generic server only.
Get working mode definitions for the generic server.
The default implementation in IGeneric.cs/vb initializes default values and tries to read the configuration definitions from the file DANSrv.exe.config respectively web.config in XML DA servers.
The default method can be replaced by defining an overload in ServerAdapt.cs/vb. The definitions can be made in the code to prevent them from being changed without a recompilation.
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As AppPlugin Dim clientUpdateMode As Integer Dim writeCacheUpdateMode As Integer Dim exeStartupMode As Integer Dim lookupMode As Integer Dim itemNameSpecialsMode As Integer Dim notYetUsed4 As Integer Dim notYetUsed5 As Integer Dim notYetUsed6 As Integer Dim value As Integer value = instance.GetModeDefinitions(clientUpdateMode, writeCacheUpdateMode, exeStartupMode, lookupMode, itemNameSpecialsMode, notYetUsed4, notYetUsed5, notYetUsed6) |
C# | |
---|---|
public new int GetModeDefinitions( out int clientUpdateMode, out int writeCacheUpdateMode, out int exeStartupMode, out int lookupMode, out int itemNameSpecialsMode, out int notYetUsed4, out int notYetUsed5, out int notYetUsed6 ) |
Parameters
- clientUpdateMode
Client update mode handling:
0 (CachePoll): The client update thread periodically checks all items in active groups for changes
1 (Queue): The cache write method adds changed items to the OPC group assigned queue for each group having the item.The default value is 0 (CachePoll). In the DANSrv.exe.config the value can be defined as:
<add key="ClientUpdateMode" value="CachePoll"/> <!-- CachePoll (0) or Queue (1) -->- writeCacheUpdateMode
Controls the cache update in the handling of client write calls:
0 (Generic): The cache is updated in the generic server after returning from the customization WiteItems method. Items with write error are not updated in the cache.
1 (Custom): The generic server does NOT update the cache. The customization module has to update the cache by executing the SetItemValue callback method for each written item.The default value is 0 (Generic). In the DANSrv.exe.config the value can be defined as:
<add key="WriteCacheUpdateMode" value="Generic"/> <!-- Generic (0) or Custom (1) -->- exeStartupMode
- Determines how the server starts when the EXE file is executed. This definition has no effect when DCOM starts the server due to a client connect. The possible values are defined in the enumerator ExeStartMode.
- lookupMode
- Determines how the LookupItgemIDs client requests are handled and how property items are created and updated.
0 (LookupMode.Generic ) : LookupItemIDs requests are handled in the generic server. NSPlugin.dll is not involved. The generic server creates a thread that calls every 2 seconds the method GetPropertyValue() to update the value of the property item in the generic server cache.
1 (LookupMode.GenericNoUpdate ) : Property items are handled much like regular items. On LookupItemIDs client requests the generic server call the plug-in method LookupItemID(). This method creates the property item by calling the generic server method AddItem(). The plug-in must update the value of this item by calling the SetItemValue() method. - itemNameSpecialsMode
- Select special item ID handling.
Bit 4 == 1 (Mask 0x10) : The item ID syntax xxx[nn] is handled as access to the element nn of the array value item xxx.
The item xxx must have an array value and nn must be in the range of the actual array size. - notYetUsed4
- Can be used later without having to change the DLL interface
- notYetUsed5
- Can be used later without having to change the DLL interface
- notYetUsed6
- Can be used later without having to change the DLL interface
Return Value
Always returns S_OKTarget Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2