setting the other EventNotifier bits for UaAreaFolder

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

Moderator: uasdkcpp

Post Reply
haydee
Sr. Member
Sr. Member
Posts: 16
Joined: 03 Jul 2013, 06:03

setting the other EventNotifier bits for UaAreaFolder

Post by haydee »

Hi,

Currently, the UaAreaFolder's eventNotifier bit is fixed to SubscribeToEvents. Why is this so? Is historizing not allowed for alarm- area objects?

And if allowed, is there a way where we can set its other bits such as those for History[Read|Write]? SetEventNotifier() is not in its available methods.

Thanks.

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

Re: setting the other EventNotifier bits for UaAreaFolder

Post by Support Team »

Hi,

the class UaAreaFolder is a very special implementation of the node interface UaObject that uses the type definnition FolderType and sets the EventNotifier to SubscribeToEvents.

If you want to have more flexibility you can use the class OpcUa::FolderType. This is a more generic implementation of the UaObject node interface for FolderType. There you can set all attributes. See the following example. pArea1 and pArea2 have exactly the same settings. pArea3 also allows HistoryRead.

Code: Select all

UaAreaFolder* pArea1 = new UaAreaFolder("DemoArea", UaNodeId("DemoArea", getNameSpaceIndex()), m_defaultLocaleId);
addNodeAndReference(OpcUaId_Server, pArea1, OpcUaId_HasNotifier);

OpcUa::FolderType* pArea2 = new OpcUa::FolderType(UaNodeId("DemoArea2", getNameSpaceIndex()), "DemoArea2", getNameSpaceIndex(), this);
pArea2->setEventNotifier(OpcUa_EventNotifiers_SubscribeToEvents);
addNodeAndReference(OpcUaId_Server, pArea2, OpcUaId_HasNotifier);

OpcUa::FolderType* pArea3 = new OpcUa::FolderType(UaNodeId("DemoArea3", getNameSpaceIndex()), "DemoArea3", getNameSpaceIndex(), this);
pArea3->setEventNotifier(OpcUa_EventNotifiers_SubscribeToEvents | OpcUa_EventNotifiers_HistoryRead);
addNodeAndReference(OpcUaId_Server, pArea3, OpcUaId_HasNotifier);
Best Regards,
Unified Automation Support Team

Post Reply