10-19-2006 08:18 AM
Hello,
i want to scan for the instruments which are connected to
my GPIB-card such as the Measurement & Automation Explorer - Tool
"Scan for Instruments", in a function in VB .NET, to see which
instruments are connected at start-up and to save the addresses.
My current program runs with hard-coded addresses.
Can anyone help me creating this function or has anyone
some ideas?
Thanks
10-20-2006 03:39 AM
Use this code to get a list (array of strings) of all GPIB Devices found on your system:
string[] devices;
NationalInstruments.VisaNS.ResourceManager MyManager = NationalInstruments.VisaNS.ResourceManager.GetLocalManager();
devices = MyManager.FindResources("GPIB?*INSTR");
Hope this helps!
10-24-2006 10:10 AM
02-12-2008 11:36 AM
From a .NET standpoint this works for retrieving all available USB resources.
Public Function ResourceList() As Array Try Dim VisaRMLocal As NationalInstruments.VisaNS.ResourceManager = VisaRM.GetLocalManager Return VisaRMLocal.FindResources("USB?*INSTR") Catch ex As ExceptionMsgBox(
"Error retrieving resource list: " & ex.Message) End Try End Function