ServerCapabilities settings with configurationInMemory

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
stephenTissot
Full Member
Full Member
Posts: 9
Joined: 24 Jan 2022, 17:13

ServerCapabilities settings with configurationInMemory

Post by stephenTissot »

Hello.

I am trying to set some values in ServerCapabilities node but I can't find any property : example, trying to set ServerCapabilities/HistoryServerCapabilites: ServerTimestampSupported to true. I see some corresponging methods in C++, but is there a way in .NET ?

Thanks
Stephen

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: ServerCapabilities settings with configurationInMemory

Post by Support Team »

Hello Stephen,

most ServerCapabilities are not writable, so they must be written when the server is started.
This can be done in your ServerManager with the InternalClient.
For example:

Code: Select all

protected override void OnServerStarting(ApplicationInstanceBase application)
        {
            base.OnServerStarting(application);
            InternalClient.WriteAttribute(DefaultRequestContext, VariableIds.HistoryServerCapabilities_ServerTimestampSupported, Attributes.Value, true);
        }
Best regards
Unified Automation Support Team

stephenTissot
Full Member
Full Member
Posts: 9
Joined: 24 Jan 2022, 17:13

Re: ServerCapabilities settings with configurationInMemory

Post by stephenTissot »

Hello, thanks for your help, it works.
But when I try to update ServerCapabilities/HistoryServerCapabilites: AccessHistoryDataCapability and ServerCapabilites: MinimumSupportedSampleRate, value is not set (always false and 0)

Another questions :
How to set ServerProfileArray in ServerCapabilities ?
Our server will not support aggregated function. How can I remove that in ServerCapabilities ?
Our server will not support RequestServerStateChange and ResendData method. Is it possible to remove that from Server node tree ?
The Ressources folder of Server node contain no data. Is it possible to remove ?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: ServerCapabilities settings with configurationInMemory

Post by Support Team »

Hello Stephen,

I'll answer your questions here based on the information from your ticket so other forum users can benefit as well.
stephenTissot wrote:
04 May 2022, 14:22
But when I try to update ServerCapabilities/HistoryServerCapabilites: AccessHistoryDataCapability and ServerCapabilites: MinimumSupportedSampleRate, value is not set (always false and 0)
You have to be careful to use the right variable in InternalClient.WriteAttribute.
(This is the wrong one: VariableIds.HistoryServerCapabilitiesType_AccessHistoryDataCapability)

Code: Select all

InternalClient.WriteAttribute(DefaultRequestContext, VariableIds.HistoryServerCapabilities_AccessHistoryDataCapability, Attributes.Value, true);
InternalClient.WriteAttribute(DefaultRequestContext, VariableIds.Server_ServerCapabilities_MinSupportedSampleRate, Attributes.Value, (double)50)
stephenTissot wrote:
04 May 2022, 14:22
How to set ServerProfileArray in ServerCapabilities ?
If you do not set any profiles, the server will set default profiles (the four in the example below).
https://documentation.unified-automation.com/uasdknet/3.1.1/html/L2BaseLibConfigSchema.html#L3BaseLibConfigSchemaServerSettings

You can define server profiles in an extension in the app.config as follows.

Code: Select all

<Extension>
  <ServerSettings xmlns="http://unifiedautomation.com/schemas/2011/12/Application.xsd">
    <ProductUri>urn:UnifiedAutomation:UaServerNet</ProductUri>
    <ProductName>UnifiedAutomation UaServerNet</ProductName>
    <AvailableServerProfiles>
      <String>http://opcfoundation.org/UA-Profile/Server/StandardUA</String>
      <String>http://opcfoundation.org/UA-Profile/Server/DataAccess</String>
      <String>http://opcfoundation.org/UA-Profile/Server/Methods</String>
      <String>http://opcfoundation.org/UA-Profile/Server/EventSubscription</String>
    </AvailableServerProfiles>
    <AvailableLocaleIds>
      <String>en-US</String>
    </AvailableLocaleIds>
    <AllowDepreciatedPolicies>false</AllowDepreciatedPolicies>
  </ServerSettings>
</Extension>
stephenTissot wrote:
04 May 2022, 14:22
Our server will not support aggregated function. How can I remove that in ServerCapabilities ?
The node AggregatedFunctions is mandatory, which means you cannot delete it. But you can delete any function under it in e.g. OnServerStarting()
To delete nodes in namespace 0, do this in ServerManager at server starting.

Code: Select all

protected override void OnServerStarting(ApplicationInstanceBase application)
{
    base.OnServerStarting(application);
    this.RootNodeManager.DeleteNode(DefaultRequestContext, ObjectIds.AggregateFunction_AnnotationCount, true);
}
stephenTissot wrote:
04 May 2022, 14:22
Our server will not support RequestServerStateChange and ResendData method. Is it possible to remove that from Server node tree ?
Note that ResendData is mandatory according to the specification - so you can't remove it.
RequestServerStateChange ist also mandatory, but it can be made visible only to admin role.
stephenTissot wrote:
04 May 2022, 14:22
The Ressources folder of Server node contain no data. Is it possible to remove ?
You can delete it in OnServerStarting() like mentioned above with:

Code: Select all

this.RootNodeManager.DeleteNode(DefaultRequestContext, ObjectIds.Resources, true);
Best regards
Unified Automation Support Team

Post Reply