|
I have the VB.NET code as, Imports OPCSystemsInterface Public Class OPCselectserver Public Sub ListAllServers() Dim srv() As String = {} Dim srvlist As OPCSystemsInterface.IOPCSystems ' Here I get the Null reference error Try srv = srvlist.GetListOfOPCServers("Localhost") MsgBox(srv1.Length) ' it will show the number of available OPC servers Catch ex As Exception MsgBox(ex.ToString) End Try EndSub End Class Here I create object of OPCSystemsInterface.IOPCSystems as srvlist It gives error as null reference exception. so please tell me how to declare object of the interface 'IOPCSystems' I want use this object for listing OPC servers in the PC. OPCSystemsInterface is the NameSpace which contains interface IOPCSystems |