Hi,
I am getting an error when calling EasyDAClient1.ReadItem(). This is my code below. All of the parameters are not null.
Private Function ReadOPCItemValeuDA(szItemName As String) As DAVtq
Dim exception As Exception = Nothing
Dim vtq As DAVtq = Nothing
Dim cName As String
If gComputerName.Length = 0 Then ' Jan-7-2023 V1.0.101
cName = Environment.MachineName
Else
cName = gComputerName
End If
Try
vtq = EasyDAClient1.ReadItem(cName, gServerNameURL, szItemName)
Catch ex As OpcException
exception = ex
End Try
ReadOPCItemValeuDA = vtq
End Function
The error is:
System.ArgumentNullException: 'Value cannot be null.
Parameter name: client'
System.ArgumentNullException
HResult=0x80004003
Message=Value cannot be null.
Parameter name: client
Source=OpcLabs.EasyOpcClassic
StackTrace:
at OpcLabs.EasyOpc.DataAccess.IEasyDAClientExtension.ReadItem(IEasyDAClient client, String machineName, String serverClass, String itemId)
at EBO_Browse.Form1.ReadOPCItemValeuDA(String szItemName) in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(2a)\Form1.vb:line 1365
at EBO_Browse.Form1.GlobalTagBrowse_DA(String MyServer, String MyGroup) in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(2a)\Form1.vb:line 476
at EBO_Browse.Form1.AddOPCItemsToolStripMenuItem_Click(Object sender, EventArgs e) in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(2a)\Form1.vb:line 1008
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at EBO_Browse.My.MyApplication.Main(String[] Args) in :line 81
Thank you.
Mike