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
ServerCapabilities settings with configurationInMemory
Moderator: uasdknet
-
- Full Member
- Posts: 9
- Joined: 24 Jan 2022, 17:13
- Support Team
- Hero Member
- Posts: 3068
- Joined: 18 Mar 2011, 15:09
Re: ServerCapabilities settings with configurationInMemory
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:
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
Unified Automation Support Team
-
- Full Member
- Posts: 9
- Joined: 24 Jan 2022, 17:13
Re: ServerCapabilities settings with configurationInMemory
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 ?
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 ?
- Support Team
- Hero Member
- Posts: 3068
- Joined: 18 Mar 2011, 15:09
Re: ServerCapabilities settings with configurationInMemory
Hello Stephen,
I'll answer your questions here based on the information from your ticket so other forum users can benefit as well.
(This is the wrong one: VariableIds.HistoryServerCapabilitiesType_AccessHistoryDataCapability)
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.
To delete nodes in namespace 0, do this in ServerManager at server starting.
RequestServerStateChange ist also mandatory, but it can be made visible only to admin role.
I'll answer your questions here based on the information from your ticket so other forum users can benefit as well.
You have to be careful to use the right variable in InternalClient.WriteAttribute.stephenTissot wrote: ↑04 May 2022, 14:22But when I try to update ServerCapabilities/HistoryServerCapabilites: AccessHistoryDataCapability and ServerCapabilites: MinimumSupportedSampleRate, value is not set (always false and 0)
(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)
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>
The node AggregatedFunctions is mandatory, which means you cannot delete it. But you can delete any function under it in e.g. OnServerStarting()stephenTissot wrote: ↑04 May 2022, 14:22Our server will not support aggregated function. How can I remove that in ServerCapabilities ?
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);
}
Note that ResendData is mandatory according to the specification - so you can't remove it.stephenTissot wrote: ↑04 May 2022, 14:22Our server will not support RequestServerStateChange and ResendData method. Is it possible to remove that from Server node tree ?
RequestServerStateChange ist also mandatory, but it can be made visible only to admin role.
You can delete it in OnServerStarting() like mentioned above with:stephenTissot wrote: ↑04 May 2022, 14:22The Ressources folder of Server node contain no data. Is it possible to remove ?
Code: Select all
this.RootNodeManager.DeleteNode(DefaultRequestContext, ObjectIds.Resources, true);
Best regards
Unified Automation Support Team
Unified Automation Support Team