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.

QuickOPC DA COM VB6 [order of item change events]

More
16 Jun 2016 08:55 #4157 by support
Thank you.
I do not see any problem in your code.

The most likely explanation is that the OPC server has sent the values in the order you are observing. You may want to ask the server vendor about it.

If that turns necessary, it would be possible to use a tool (OPC Analyzer) to capture a log of the communication and analyze it afterwards. The tools behaves as an OPC server and an OPC client at the same time, passing the messages through while logging them. Top use the tool, it is therefore necessary to change the app code so that it connect to the OPC Analyzer instead. If you do not find any other explanation (from the server vendor), and are willing to make the extra work wit the tool, let me know. Capturing the communication would allow us to determine whether it is the server that has sent the values in that order, or the client that has somehow changed their order. In my view, it is unlikely that the problem is on client side, but of course one needs some data/facts to prove that.

Best regards

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

More
16 Jun 2016 05:20 - 16 Jun 2016 08:50 #4154 by pacgmbh
Hello support.


The changed values are stored within the eventhandler in internal variables and
are written only there.
All items of the MultipleItemsSubscription (framewords and data)
has set their RequestedUpdateRate to 1000ms.
After receiving the 1. change event of the multiple subscription I wait
200ms to receive all events of the changed items. If changes occured
I do the log output to the logfile.

Here the code extract of the event handler:

Private Sub oOPCClientRIndex230_ItemChanged(ByVal sender As Variant, ByVal eventArgs As OpcLabs_EasyOpcClassicInternal.EasyDAItemChangedEventArgs)
 
Static sItemDescr As String
 
 
    ' Args ok ?
    If Not eventArgs Is Nothing Then
 
        ' Exception ?
        If Not eventArgs.Exception Is Nothing Then
            ' Protokollierung
            If bProtokollierung Then
                If iLoglevel >= cLOGLevel_All Then
                    LOG_Fehler sLogItem, Now(), _
                               "Exception: " & eventArgs.Exception.Source & "/" & eventArgs.Exception.Message
                End If
            End If
            Exit Sub
        End If
 
        If Not eventArgs.Vtq Is Nothing Then
            If Not eventArgs.Arguments.ItemDescriptor Is Nothing Then
                sItemDescr = eventArgs.Arguments.ItemDescriptor.ItemId
            Else
                sItemDescr = "???"
            End If
 
            ' Frames ?
            Select Case eventArgs.Arguments.ItemDescriptor.ItemId
                Case "AFGateway.PAL_" & sKennungPalettierer & "_RM>PC.Frame_A":
                    iFrameOIndex230 = CInt(eventArgs.Vtq.Value)
                    Exit Sub
                Case "AFGateway.PAL_" & sKennungPalettierer & "_RM>PC.Frame_E":
                    iFrameUIndex230 = CInt(eventArgs.Vtq.Value)		    
                    Exit Sub
            End Select
 
	    ....
 


Thanks
J.
Last edit: 16 Jun 2016 08:50 by support. Reason: code formatting

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

More
15 Jun 2016 14:12 #4150 by support
Assuming that you create log entry like

#2016-05-17 23:10:31#,"Frame-> 2456/2455 <---- B

somehow inside an ItemChanged event handler, which carries just one value with it, where does the second value come from? Is it remembered in a VB variable from the last change, or do you read it inside the event handler?

Can you post the relevant code here?

Thank you

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

More
15 Jun 2016 12:54 #4149 by pacgmbh
Hello support,

we use just subscriptions with EasyDAClient.SubscribeMultipleItems
(with Items -> framewords OPCVariables and the data OPCVariables).

Thanks
J.

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

More
15 Jun 2016 06:18 - 15 Jun 2016 06:19 #4147 by support
Hello.

Can you please first clarify this:

In our application we use QuickOPC with SyncReadGroup (GroupReadTime = 1000ms).
We receive the ChangedEvents for each frameword opc variable and the data opc variables.


It is not clear to me, whether you (on the same or related data) use:

a) just "one-time" Read-s (e.g. EasyDAClient.ReadItem/ReadItemValue/ReadMultipleItems/ReadMultipleItemValues),
b) just subscriptions (e.g. EasyDAClient.SubscribeItem/SubscribeMultipleItems), or
c) both.

The reason why it is not clear to me is that on your first sentence you refer to "reads", while in the second sentence you refer to events - but they are only raised with subscriptions, not Read-s.

Thank you
Last edit: 15 Jun 2016 06:19 by support.

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

More
15 Jun 2016 06:14 - 15 Jun 2016 06:15 #4146 by support
From: J.
Sent: Wednesday, June 15, 2016 6:20 AM
To: Z.
Subject: QuickOPC DA COM VB6

Hello [...],

we user QuickOPC DA COM in a VB6 application to connect to a softing OPCServer which connects to a Siemens S7-PLC.

Our S7 datablock (in ascending address order), every data has it's corresponding OPCvariable in the OPCserver :
<UpperFrameWord>
<Data1>
<Data2>
<Data3>
...
<LowerFrameWord>
The framewords are incremented simultaneously in the plc every 200-500ms.
The OPCServer polls the datablock in intervalls of 500ms.

In our application we use QuickOPC with SyncReadGroup (GroupReadTime = 1000ms).
We receive the ChangedEvents for each frameword opc variable and the data opc variables.
If one of the data opc variable is changed we log the frameword and data to a file.

Here a part of the log file entries in chronological order (values are upper/lower frameword)r:
#2016-05-17 23:09:45#,"Frame-> 2419/2419
#2016-05-17 23:10:30#,"Frame-> 2456/2456  <---- A
#2016-05-17 23:10:31#,"Frame-> 2456/2455  <---- B
#2016-05-17 23:10:31#,"Frame-> 2456/2456
Here my question:
Could there be a situation in QuickOPC were the frameword change events with older data were raised after the change events with newer data, not in chronological order ?

See the marked log-entry B:
The value of the lower frameword has an old value, although the previous raised event (previous log entry A) has an value which is greater (newer).

Do You have an idea, what is the problem ?

Best regards.
J.
Last edit: 15 Jun 2016 06:15 by support.

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

Moderators: support
Time to create page: 0.058 seconds