Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Did you mean: 

Get a list of GPIB board/interfaces.

Go to solution

I would like to know how to get a list of GPIB board/interfaces that are connected to a computer using the NI4882 library in VB.NET.




0 Kudos
Message 1 of 5
Accepted by topic author gls

Hi Garth,


There are a couple of options for you to retrieve the list of GPIB Devices. The one that I would suggest is to use the VISA API instead of the 488.2 API to achieve this. In the VISA API, there is a method called "Find" in the CNiVisaResourceList Class. It returns a list of names of resources in the VISA system. It also takes in inputs where you can use a regular expression to specify exactly which interface you want to search.

National Instruments
Applications Engineer
Message 2 of 5



Thanks for the reply.  I think I found the method you recommended but I couldn't find information on the expression that is used in the FindResources function.  I did find an example but it returns instruments as well as the board/device which I don't need.  I would just like the board/device returned.  Is there an expression that does this?  May seem trivial but if I have twenty instruments hooked to one board/device I don't want twenty items returned, I just want one.


A sample of my code is below:



Dim vs As NationalInstruments.VisaNS.ResourceManager
Dim resources() As String

vs = NationalInstruments.VisaNS.ResourceManager.GetLocalManager
resources = vs.FindResources("GPIB?*INSTR")



0 Kudos
Message 3 of 5



Playing around with the expression I found the correct one.  Thanks for your help!



0 Kudos
Message 4 of 5

I know this thread is quite old but do you have an example of what could be used in VB or VBA for how to find all instruments on a GPIB? And what references would have to be added for it to work?

0 Kudos
Message 5 of 5