Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to query the 488.2 board/controller/interface name (mainly GPIB-USB)

Solved!
Go to solution

Have an app that talks to HP8510 & HP8720 NWAs. I can inquire which type of test set is connected, but how do I query which GPIB-USB model is connected? Using an "A" model interface requires some read status to complete, but the "HS" hangs (for what seems like the timeout period). If I comment out the read status code, the "HS" works fine. Somehow the NI programs that come with the 488.2 software package can get all sorts of info from about the controller. Please point me to the web page/manual/whatever that shows how to do this.

Thanks

0 Kudos
Message 1 of 12
(5,349 Views)

Hi,

 

What programming language are you using?  In LabVIEW, you can modify the GPIB-VISA vi in the example program to do this quite easily.  First, go into Measurement & Automation Explorer and see what your GPIB Interface ID is for both devices.  Then, add a VISA Find Resource VI and an index array function before the property node.  I have attaced screenshots of the front panel and block diagram for your convinience.  Let me know if this helps!

 

Regards,

 

Todd V. 

National Instruments
Applications Engineer
NI Prototyping Community
Download All
0 Kudos
Message 2 of 12
(5,306 Views)

I'm using the 488.2 drivers themselves - the app is in Visual C++ 6, but I can "read" Visual Basic too.

Thanks,

kenlbowen

0 Kudos
Message 3 of 12
(5,297 Views)

Hi,

 

Thanks for your quick response.  You can find out more about the VISA Find Resource function in the NI-VISA help.  In C, the function is viFindRsrc.  It would work the same way as the VI I posted previously.  Have a great day!

 

Regards,

 

Todd V. 

National Instruments
Applications Engineer
NI Prototyping Community
0 Kudos
Message 4 of 12
(5,268 Views)

I'm using only the gpib32 drivers - no VISA or anything else. I'll look at VISA, but I don't want to load another driver/library if I can help it. I'm trying to keep things simple.

kenlbowen

0 Kudos
Message 5 of 12
(5,255 Views)
Solution
Accepted by topic author kenlbowen

Hi,

The properties of all GPIB boards that you have connected to your computer are located in a GPIB.ini file.  The location of this file can be different based on which version of NI-488.2 that you have.  I have version 2.52, and on my system, it is located at C:»Documents and Settings»All Users»Application Data»National Instruments»NI-488.2»gpib.ini.  It is imporant to note that this file should not be changed under any circumstance, as it could cause many problems in Measurement & Automation Explorer (MAX).  Once you open this file, you can see under "BoardName" which GPIB board is assigned to GPIB0, GPIB1 and so forth.  You can then programmatically parse this file (in Read-Only mode) to see which board is connected to your instrument.  Have a great day!

 

Regards,

 

Todd V. 

National Instruments
Applications Engineer
NI Prototyping Community
0 Kudos
Message 6 of 12
(5,228 Views)

I'm running version 2.4. I found gpib.ini in the system32 directory. One of the test systems is using a GPIB-USB-A and running vers. 2.2. I'll ask them to find out where the ini file resides on their setup. Now I have to figure out a way to determine which version of the gpib library is being run in order to know where to look for the ini file. It would've been nice if I could have done an *IDN? on the controller and got back something useful. Oh, well.

Thanks for all your guys' help.

kenlbowen

 

0 Kudos
Message 7 of 12
(5,220 Views)

For me, that did not work..

 

I searched my system for all gpib.ini files, only found one, about 2 years old, but.. it only contained the built in adapter, but not the newly (today) connected USB adapter (GPIB0 had a proper boardname, GPIB1 had "none"). MAX shows it properly, and I can also access it from C.

 

Any ideas on this?

 

BTW, a command would be great.. or is it maybe possible to at least poll for the type (PCI/PXI/USB/...)?

 

Thx + best wishes

diadev

0 Kudos
Message 8 of 12
(4,752 Views)

You may want to check this KnowledgeBase article out to see where you can find the gpib.ini file based on which version of the 488.2 driver you have.

 

diadev, you may want to try reinstalling/repairing your NI-488.2 driver. MAX pulls information about connected GPIB devices from the gpib.ini file, so you may want to also make sure you're looking at the correct gpib.ini file as referenced in that KnowledgeBase.

Justin E
National Instruments R&D
Message 9 of 12
(4,722 Views)

I searched the whole system.. not by hand 🙂 but rather using the all mighty windows search, so I found any gpib.ini file on the system, and then I checked all I found. So.. I did this to circumvent worrying about a specific location. I then checked the first 2 entries (2 adapters installed), one being the PCI, the second in the system was USB, but the entry in the gpib.ini read NONE.

 

Maybe the error is related to the fact that I used a USB-GPIB adapter (first time I connected it)? But then again, MAX displayed everything properly. So that kind of goes against MAX using that file or me having understood the process.

 

I am using MAX 4.5.0f0, which should be fairly recent.

 

The problem I have is that I have built a generic adapter search that is supposed to work on several systems with several adapters. Being able to distinguish them by type (e. g. if there is a PCI and an USB adapter connected) would be very helpful.

 

Best wishes

0 Kudos
Message 10 of 12
(4,695 Views)