1
Support Questions / Re: AdvHMI controls are not being updated on OpcDaCom driver, soft ver 3.97a
« on: January 18, 2015, 06:27:32 PM »
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
Anyway the final version of DataChangedCallBack is this:
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]
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