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,609 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,601 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,577 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
(4,302 Views)