Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Alarm And Event Subscription

More
03 Jun 2024 09:19 #12838 by Jannie@Moore
Hi, Thank you, i think this will be enough, i have verified on my source there is no code

Please Log in or Create an account to join the conversation.

More
03 Jun 2024 08:50 #12837 by support
Hello.

OPC A&E does not provide Area in the event notifications. The QualifiedSourceName, however, in AEEventData, will most likely contain an area identification in it as well, plus the source within the area. How precisely it will look (the syntax of the string) is, however, server-specific.

OPC A&E does not provide CategoryName in the event notifications. It provides a CategoryId (an integer), which is part of AEEventData. You can obtain the event category information, including how the Ids correspond to the Names, by calling EasyAEClient.QueryEventCategories. If you need the category name inside the event notification handler, you should call EasyAEClient.QueryEventCategories upfront (not inside the handler!), store the information obtained, and then use it inside the handler to convert category Id to its name.

I do not know what you mean by Code.

Regards

Please Log in or Create an account to join the conversation.

More
03 Jun 2024 06:53 - 03 Jun 2024 08:45 #12836 by Jannie@Moore
Hi there i need to be able to access Area, CategoryName and Code on the below alarm event.
public void client_Notification(object sender, EasyAENotificationEventArgs e)
{
    try
    {
        var AE_subscription = Server.Subscriptions.FirstOrDefault();
        if (AE_subscription != null)
        {
 
 
            if (e.Exception != null)
            {
                Console.WriteLine("Exception Message: {0}", e.Exception.Message);
                Console.WriteLine("Exception Source: {0}", e.Exception.Source);
                return;
            }
 
            if (!(e.EventData is null))
            {
                ConditionalAlarmData alarmData = new ConditionalAlarmData
                {
                    Area = null,
                    Source = e.EventData?.QualifiedSourceName,
                    CategoryID = e.EventData?.CategoryId,
                    CategoryName = null,
                    TimeStamp = e.EventData?.Time,
                    Message = e.EventData?.Message,
                    Severity = e.EventData?.Severity.ToString(),
                    Condition = e.EventData?.ConditionName,
                    SubCondition = e.EventData?.SubconditionName,
                    Quality = e.EventData?.Quality.ToString(),
                    Enabled = e.EventData?.Enabled.ToString(),
                    Active = e.EventData?.Active.ToString(),
                    Acknowledged = e.EventData?.Acknowledged.ToString(),
                    ActiveTime = e.EventData?.ActiveTime,
                    Code = null,
                    AcknowledgedRequired = e.EventData?.AcknowledgeRequired.ToString()
                };
 
                _fileLogger.Log($@"Testing AE " + stateItem.ConnectionString, true, "AE Client"); ;
 
 
            } 
        }
    }
    catch
    {
        _fileLogger.Log($@"Error Occured while getting event data.", true, "AE Client");
    }
 
}
Last edit: 03 Jun 2024 08:45 by support.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.044 seconds