Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Populating list with connected GPIB interfaces

I'm working on the setup section of an APP in Delphi5.0 using the GPIB-32.DLL and am a little baffled. Ni supplied this little gizmo that searches for GPIB interfaces (not devices). I would like to emulate this functionality for my application in a setup wizard sort of way so the end user can simply select from a list of 'detected' interfaces. In looking at the DLL calls they all seem to require previous knowledge of the device location. So I'm wondering if there is a set range of possible Primary and Secondary addresses I can use to just loop through searching for an interface. I'm assuming here that anything that wouldn't toss a failure when sent a Pri/Sec Address would be a set of valid device ports. On that note...
are there some specific commands to issue that will return a string telling me exactly what it found on that Pri/Sec address?

Thanks!

CT
0 Kudos
Message 1 of 3
(3,416 Views)
Ok.. I made some progress. Using SendIFC and ibfind, etc, watching NiSpy I have determined this is coming back as an Integer and other Ni applications use the Init_DA_Brds to obtain a translation of the integer to descriptive title. However I don't have access to that and the only reference I found of the device list codes is from 1999 which does not include some of the newest hardware including the USB based devices.

Is there a newer list of product codes available?
0 Kudos
Message 2 of 3
(3,416 Views)
You mention that NI supplied the gizmo to search for interfaces. To determine what the NI application is doing, just run NI-Spy in the background. NI-Spy will log all calls made to NI-488.2 in a nice convenient window.

To find an interface, just call ibfind GPIBx (where x is a number). If it returns an ibsta without the ERR bit set (0x8000), you have found a valid interface. If you get the ERR bit set, you have found an invalid interface.
Message 3 of 3
(3,416 Views)