From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan for instruments to save adresses

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

0 Kudos
Message 1 of 4
(4,122 Views)

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!

0 Kudos
Message 2 of 4
(4,114 Views)
Thank you, I will test it tomorrow.
But I found an other Funktion called FindLstn (boardID%, padlist%(), resultlist%(), limit%).
I tried to work with this function, but I don't know where I get teh padlist!?
The padlist is a list of primary addresses that is terminated by NOADDR.
How do I word with this function?
0 Kudos
Message 3 of 4
(4,090 Views)

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 Exception

MsgBox(

"Error retrieving resource list: " & ex.Message)

End Try

End Function

0 Kudos
Message 4 of 4
(3,815 Views)