![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
06/02/2023
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
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](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
06/02/2023
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
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.
1 Guest(s)