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.

Vendor Specific Attributes still being received after disabling them from the server

More
22 Nov 2017 14:17 #5673 by support
Hello,

I understand what you are saying, but I am somewhat confused by the fact that you obviously think that this is an issue on the client side.

I think what you have described clearly implies that it is the server that is still sends the events with the attributes. Especially if you have also restarted the client application. The only explanations then would be that we either a) make these values up internally, or b) persist them over the client process invocations somewhere (e.g. on the disk) and the reload them and ship them to you. We know for sure that none of that is true...

If I misunderstood something or you can explain why you think this *can* be a client-side problem, please elaborate on that in your reply.

Note: It is by design that, no matter what, that the AEEventData.AttributeValues dictionary always contains entries for all the attributes you have subscribed to. If some attributes were invalid at the time of subscribing, that would be indicated by an event notification with a failure indication (Exception != null), coming after the EasyAEClient.SubscribeEvents call.

Best regards

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

More
22 Nov 2017 10:36 #5671 by usmanshahid
I am currently evaluating the QuickOPC A&E SDK. I am using it through it's Nuget package (Version: 5.51.465)

So I have an OPC A&E Server (Using IntelliMax by Sensys) which is publishing 50 events per second. The events have some vendor specific attributes attached so I use the following code to subscribe to these events:
public class TestClass
    {
        public static void Main(string[] args)
        {
            var client = EasyAEClient.Create();
            client.Notification += PublishCallback;
            var servers = client.BrowseServers("");
            ServerElement myIntendedServer = null;
            foreach (var server in servers)
            {
                if (server.ProgId.Equals("Kepware.KEPServerEX_AE.V6"))
                {
                    myIntendedServer = server;
                    break;
                }
            }
            if (myIntendedServer != null)
            {
                var eventCategories = client.QueryEventCategories("", myIntendedServer.ProgId);
                long[] categoryIds = new long[eventCategories.Count];
                var attributeDictionary = new AEAttributeSetDictionary();
                for (int i = 0; i < eventCategories.Count; i++)
                {
                    categoryIds[i] = eventCategories[i].CategoryId;
                    if (eventCategories[i].AttributeElements != null && eventCategories[i].AttributeElements.Count > 0)
                    {
                        long[] attributes = new long[eventCategories[i].AttributeElements.Count];
                        for (int j = 0; j < eventCategories[i].AttributeElements.Count; j++)
                        {
                            attributes[j] = eventCategories[i].AttributeElements[j].AttributeId;
                        }
                        attributeDictionary.Add(eventCategories[i].CategoryId, attributes);
                    }
                }
 
                var filter = new AESubscriptionFilter
                {
                    Categories = categoryIds
                };
 
                client.SubscribeEvents("", "Kepware.KEPServerEX_AE.V6", 0, null, filter, attributeDictionary);
                System.Threading.Thread.Sleep(int.MaxValue);
                client.UnsubscribeAllEvents();
            }
        }
 
        private static void PublishCallback(object sender, EasyAENotificationEventArgs e)
        {
            if (e.Exception != null)
            {
                Console.WriteLine("Server disconneced: ", e);
            }
            else if (e.RefreshComplete)
            {
                Console.WriteLine("RefreshComplete sent");
            }
            else if (e.EventData == null)
            {
                Console.WriteLine("Server connected");
            }
            else
            {
                Console.WriteLine("Event received: [{0}]", e.EventData.ToString());
                if (e.EventData.AttributeValues != null && e.EventData.AttributeValues.Count > 0)
                {
                    Console.WriteLine("Vendor Specific Events: ");
                    foreach (var attribute in e.EventData.AttributeValues)
                    {
                        Console.WriteLine("[{0}]:[{1}]", attribute.Key, attribute.Value);
                    }
                }
            }
        }
    }

I receive the events with vendor specific attributes. But if, during this subscription I disable the vendor specific events on the server side (I disable->enable the events, and restart the server so the disconnect and connect events are also published), I keep receiving the Vendor specific attributes in the events. I even restarted the test application with this code and the vendor specific attributes disabled on the server side. I still receive them in events.
Attachments:

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

Moderators: support
Time to create page: 0.046 seconds