How to Override EventTypes to Address space in OPC UA server which is input to the OPC UA Client|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
How to Override EventTypes to Address space in OPC UA server which is input to the OPC UA Client
Avatar
REDDIBABU VALLETI
New Member
Members
Forum Posts: 2
Member Since:
06/02/2023
sp_UserOfflineSmall Offline
1
04/08/2024 - 03:33
sp_Permalink sp_Print

How to Override EventTypes to Address space in OPC UA server which is input to the OPC UA Client. Solution which i am trying in .net core 6.0.

public void CreateNodeManagerAddressSpace(IDictionary<NodeId, IList<IReference>> externalReferences, string configPath)
{

}

var eventTypes = eventTypeList ?? tagConfig.GetDaDataModel().EventTypes;

need to override the address space event types with above list of event types.

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
04/08/2024 - 07:33
sp_Permalink sp_Print
Avatar
REDDIBABU VALLETI
New Member
Members
Forum Posts: 2
Member Since:
06/02/2023
sp_UserOfflineSmall Offline
3
04/08/2024 - 08:03
sp_Permalink sp_Print

I have a console application which act as a server, here by default OPCUA Event Types are loading , instead of default, i have a list of Event types, same thing need to be loaded to the address space. here i have to override the default event types from opcua to my application specific event types.

public void CreateNodeManagerAddressSpace(IDictionary<NodeId, IList<IReference>> externalReferences, string configPath)
{
// Load the tag configuration File
IUaDaConfig tagConfig = new UaDaConfig();
IHistoryConfig config = new HistoryConfig();
config.Initialize(configPath);
if (!tagConfig.Initialize(config))
{
Log.Logger.Error(“Starting service without configuration.”);
this.State = ServerState.NoConfiguration;
return;
}

#pragma warning disable S2589 // Boolean expressions should not be gratuitous
var serverConfigs = tagConfig?.GetServerConfigs();
#pragma warning restore S2589 // Boolean expressions should not be gratuitous
var dbConfig = tagConfig.GetDBConfig();
var historyAccessServer = tagConfig.GetDaDataModel().HistoryAccessServer;

dbConfig.DbConfiguration = new DbConfiguration();

List<Configuration.EventType> eventTypeList = GetAllEventTypeList(this.ConnectionString);
var eventTypes = eventTypeList ?? tagConfig.GetDaDataModel().EventTypes;

var nodes = eventTypes.GroupBy(x => x.ParentEventTypeId).ToList();

 

from above code, nodes has BaseeventType under Audit to System event, these list have to load.

Share some sample to load custom event types to address space in OPC UA clinet.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 24
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1446
Posts: 4890