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.

× If you are developing in .NET, but are using the OPC-UA (OPC Unified Architecture), please post in the QuickOPC-UA category instead.

EasyDAItemChangedEventHandlers

More
24 Mar 2023 18:34 #11639 by support
Also,

for a list of changes in each version, see kb.opclabs.com/Versions (clicking on the links under "What's New" leads to pages with more details).

regards
The following user(s) said Thank You: hkadhim

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

More
24 Mar 2023 18:32 #11638 by support
Hello.

Events that supplied multiple changes at once were removed, because in the end they have not provided the performance improvement they were supposed to have. Simply use the events that are generated once per each change.

It is also possible that the name of the type providing item change event arguments have changed - 5.23 is very old version (might be approaching 10 years). 5.59 isn't quite up-to-date either.

Here is the current example code:, you can learn the type name from it:
opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...%20to%20a%20single%20item.html
' Hooking up events and receiving OPC item changes.
 
Imports System.Threading
Imports OpcLabs.EasyOpc.DataAccess
Imports OpcLabs.EasyOpc.DataAccess.OperationModel
 
Namespace DocExamples.DataAccess._EasyDAClient
    Partial Friend Class SubscribeItem
        Shared Sub Main1()
            Using client = New EasyDAClient()
                Dim eventHandler = New EasyDAItemChangedEventHandler(AddressOf client_ItemChanged)
                AddHandler client.ItemChanged, eventHandler
 
                Console.WriteLine("Subscribing item...")
                client.SubscribeItem("", "OPCLabs.KitServer.2", "Demo.Ramp", 200)
                Thread.Sleep(30 * 1000)
                client.UnsubscribeAllItems()
                RemoveHandler client.ItemChanged, eventHandler
            End Using
        End Sub
 
        Private Shared Sub client_ItemChanged(sender As Object, e As EasyDAItemChangedEventArgs)
            If e.Succeeded Then
                Console.WriteLine(e.Vtq)
            Else
                Console.WriteLine("*** Failure: {0}", e.ErrorMessageBrief)
            End If
        End Sub
    End Class
End Namespace
 


I hope this helps
The following user(s) said Thank You: hkadhim

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

More
24 Mar 2023 18:22 #11637 by hkadhim
Hello,

I used to have a working function in version 5.23 and then I upgraded to the latest version 5.59 and it doesn't work anymore, ItemChanged & MultipleItemsChanged functions, the DataAccess.EasyDAMultipleItemsChangedEventArgs and DataAccess.EasyDAItemChangedEventHandlers do not seem to exist anymore:
Public Sub ItemChanged(ByVal sender As Object, ByVal e As DataAccess.EasyDAItemChangedEventHandlers) Handles m_opcClient.ItemChanged
 
        Dim Tag As HQTag = CType(e.State, HQTag)
 
        If e.Exception IsNot Nothing Then
            Tag.ServerError = e.Exception.GetHashCode
        Else
            Tag.Value = e.Vtq.Value
        End If
 
        'RaiseEvent TagChanged(Tag)
 
    End Sub
and for the MultipleItemsChanged:
Public Sub ItemChanged(ByVal sender As Object, ByVal e As DataAccess.EasyDAItemChangedEventHandlers) Handles m_opcClient.ItemChanged
 
        Dim Tag As HQTag = CType(e.State, HQTag)
 
        If e.Exception IsNot Nothing Then
            Tag.ServerError = e.Exception.GetHashCode
        Else
            Tag.Value = e.Vtq.Value
        End If
 
        'RaiseEvent TagChanged(Tag)
 
    End Sub

any help is much appreciated

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

Moderators: support
Time to create page: 0.055 seconds