Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - romana

Pages: [1]
1
Yes it fixed the problem but not in the AsyncReadCompleteCallback method around line 300 but in the DataChangedCallBack sub around line 476. So the driver uses onChange event of OPC server not sync reads at least in case of RS Linx Classic. There is a For iteration loop so instead values(0) there should be values(i). I am not sure if sync and async callbacks are ever used by AdvancedHMI controls on the screen, I play with basic labels and messagedisplaybyvalue controls and it seems not but I suggest to apply the change whenever the following line or similar construction appears
Code: [Select]
Dim x As New MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs(ReturnValues, values(0).ItemName, CUShort(clientHandle))
Anyway the final version of DataChangedCallBack is this:
Code: [Select]
Private Sub DataChangedCallBack(ByVal clientHandle As Object, ByVal requestHandle As Object, ByVal values() As Opc.Da.ItemValueResult)

For i = 0 To values.Length - 1
Dim ReturnedValues() As String = {Convert.ToString(values(i).Value)}
Dim PolledAddress As PolledAddressInfo = DirectCast(values(i).ClientHandle, PolledAddressInfo)

Dim PLCAddress As String = values(i).ItemName
If m_OPCTopic IsNot Nothing AndAlso Not String.IsNullOrEmpty(m_OPCTopic) Then
PLCAddress = PLCAddress.Substring(m_OPCTopic.Length + 2)
End If

Dim x As New MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs(ReturnedValues, PLCAddress, 0)
x.SubscriptionID = PolledAddress.ID
Dim z() As Object = {Me, x}
m_SynchronizingObject.BeginInvoke(PolledAddress.dlgCallBack, z)

Next
End Sub
and it works thus closes the topic for me.
Thanks for fast reply.

Also after some tries with fast updating PLC tags such as production counter of a machine (decorator - offset printer) running 1500 products per minute I add the following line

Code: [Select]
SubscriptionState.UpdateRate = 250 after
Code: [Select]
SubscriptionState.Name = "SubscribedGroup" on the line 383. This will set another parameter of any OPC group that correspondents to update rate of a group. When a Update Rate is set to 250ms for example instead of default 1ms then my production counter is updated more continuously without freezing

2
Bug report

Tools:
for application development I am using: RSLogix Emulate 5000 to emulate PLC, RSLinx Classic as OPC server and wanted to try AdvancedHMI v3.97a.

Bug:
I open a new basic AdvancedHMI project, add communication driver OPCDaCom and set its all neccessary parameters then add any HMI controls like BasicLabel for example and set a PLCAddressValue and build and run application. Main Forms opens but the BasicLabel is not updated with the PLC read value, nothing happens, no any faults. I try the previous version 3.7 of AdvancedHMI and follow the same pattern. Result: works great, I try the newest relase v3.97c and the same: no updates, nothing happends on the screen.

Some troubleshooting:
When this happends I can see in RSLinx Classic: OPC Group Diagnosctics that groups are added properly and Subscription Packets are flowing. Also Active DDE/OPC Topic/Item List shows that desired tag is being read from a PLC. So subscriptions work there is sth wrong with callbacks

Possible root cause:
After studing the code for a little I have found the following conditional in SubscriptionHandler.vb in SubscibedDataReturned sub

Code: [Select]
Private Sub SubscribedDataReturned(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
        For Each Subscript In SubscriptionList
            Dim address As String = Subscript.PLCAddress
            If Subscript.Invert Then
                address = Subscript.PLCAddress.Substring(4)
            End If

            If (e.PlcAddress Is Nothing) OrElse (String.Compare(address, e.PlcAddress, True) = 0) Then
 
[and so on until control update]
the second part of the last conditional compares two strings but when using OpcDaCom driver the address variable is in the form:
address=PLCtag
while e.PlcAddress=[OPCTopic]PLCtag what may cause the problem
so even when everything os OK the condition fails and the control is never updated on the screen. When I change the condition everything works, controls are updated but this is not a solution for the problem

Best Regards

Pages: [1]