I am trying to migrate my code from an antique 2012 version (EasyOPC.NET 5.2) to the modern version (OPC Studio 2024.1) and I could use a little help.
My project is written using Visual Studio 2017 in Visual Basic with .Net Framework 4.7.2. It subscribes to a number of tags on multiple machines and when a tag changes value the program receives a EasyDAItemChangedEvent
I have removed the reference to the old
OpcLabs.EasyOpcClassic and added references to the following libraries:
- OpcLabs.BaseLib
- OpcLabs.EasyOpcClassic
- OpcLabs.EasyOpcClassicComponents
- OpcLabs.EasyOpcClassicCore
I have changed the
OpcLabs.EasyOpc.DataAccess.EasyDAItemChangedEventArgs to
OpcLabs.EasyOpc.DataAccess.OperationModel.EasyDAItemChangedEventArgs
I updated
Timeouts and
HoldPeriods from
EasyDaClient to
EasyDaClient.InstanceParameters
I updated
State and
ItemDescriptor from
EasyDAItemChangedEventArgs to
EasyDAItemChangedEventArgs.Arguments
But the following errors still remain:
- UpdateRates is not a member of EasyDaClient
- Reference required to assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=6.0.0.0, ...' containing the type 'IConfiguration'.
- WaitingForInitialData is not a member of DAQuality
- ErrorCode is not a member of EasyDAItemChangedEventArgs
Here are some code snippets where the errors occur:
Me.OpcConnection = New OpcLabs.EasyOpc.DataAccess.EasyDAClient(Me.components)
Me.OpcConnection.UpdateRates.ReadAutomatic = 10000
Me.OpcConnection.UpdateRates.WriteAutomatic = -1
...
Private Quality_ As DAQuality
Quality_ = DAQuality.WaitingForInitialData
...
Private Sub ProcessItemChanged(ByVal e As OpcLabs.EasyOpc.DataAccess.OperationModel.EasyDAItemChangedEventArgs)
' Display any errors
If (e.ErrorCode <> 0) Then
EventLog("OPC ERROR: " & e.Arguments.State.ToString() & " - " &
e.Arguments.ItemDescriptor.ItemId & " " &
e.ErrorMessage)
Return
End If
Could someone offer any insight into how to handle these remaining compile errors?