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.

Error when calling EasyDAClient1.ReadItem() - 'Value cannot be null.

More
08 Jan 2023 07:20 #11423 by micham

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

More
07 Jan 2023 08:35 #11420 by support
It appears that your EasyDAClient1 is null. Check it out in the debugger.

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

More
07 Jan 2023 07:47 #11419 by micham
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
Attachments:

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

Moderators: support
Time to create page: 0.050 seconds