04-17-2011 06:09 AM
I use NI HS-GPIB-USB to communicate between the computer and Dynamic Signal Analyzer(,DSA,SR785,made by Sranford.). I plan to program with VC6.0 and control the DSA with HS-GPIB-USB. Unfortunately, I can't find the NI head file and libruary files which provide the access interface to GPIB.
Please send me the two files. Thank you for your kindly help.
With my regards,
Zhao.
E-mail: xjtuthermo@foxmail.com
Solved! Go to Solution.
04-18-2011 11:33 PM - edited 04-18-2011 11:34 PM
Hey Zhao,
There is a great knowledge base article directed at this very topic. It is located at http://digital.ni.com/public.nsf/allkb/D41FD209CECEEA56862570C0005C893F . This should give you some great info on where to find the ni488.h file, and some links to examples on how to use it and connect via GPIB.
Regards,
Jake
04-18-2011 11:45 PM
Hi,Jake
Thank you for your reply. I found the head files. But i met another problems.
I use NI HS-GPIB-USB to communicate with the device .The USB was directly connected to PC without any board, but the initializtion function:
int ibdev(int BdIndx, int pad,int sad, int tmo,int eot,int eos) contains the board information, Bdlndx. I don't konw how to set because there is no board used in this case.
Regards,
zhao
04-19-2011 05:34 PM
Hey Zhao,
This seems like a new issue for a new thread, but for the sake of time, have you tried using the board number that is enumerated in Measurement and Automation Explorer as the BdIndx?
Regards,
Jake
04-19-2011 09:56 PM
Hi,Jack,
you mean i need to enumerate all BdIndxs in Measurement and Automation Explorer? Is there any better solution?
Thank you!
04-20-2011 08:35 AM
Hi Zhao,
The term BdIndex is an old term that should probably be updated to reflect the GPIB Interface that is connected to the Instrument. In essence, while your GPIB-USB-HS is a GPIB Interface, for your application, you can think of it as a "board". And really, inside the box, there is a circuit board, so in that respect, a GPIB-USB-HS is still a "board".
If you only have one GPIB Interface connected to your computer, it is by default GPIB0 where the "0" is equal to a BdIndex of 0. If you have more GPIB Interfaces connected to your computer, then GPIB1 would equal BdIndex of 1, GPIB2 would equal BdIndex of 2, and so on.
To confirm which GPIB number is assigned to your GPIB-USB-HS, you can use Measurement & Automation Explorer (MAX) to view the assignment. For information on how to use MAX, please refer to:
GPIB Installation/Configuration Troubleshooter
While the instructions are a little outdated, the steps on how to view the listing under the "Devices and Interfaces" should be somewhat similar.
Hope this information helps.
gpibtester
04-20-2011 10:02 AM
Dear sir,
Thank you for you kindly reply.But what confuse me is the difference between the GPIB address and BdIndex. As you depicted, GPIB address is equal to BdIndex?
04-20-2011 03:58 PM
Hi Zhao,
Each GPIB Instrument has a Primary Address (PAD) and possibly a Secondary Address (SAD) which correlate to the 2nd and 3rd parameters made to the ibdev call. Each GPIB Instrument must in turn be associated with a GPIB Interface (usually referred to as "board" or "board index" in the documentation) which is the first parameter in the ibdev call. One GPIB Interface/Board can communicate with up to 16 GPIB Instruments. If you have multiple GPIB Interfaces/Boards in your computer, each one can communicate with up to 16 GPIB Instruments. The GPIB driver software needs to know which GPIB Instrument is connected to which GPIB Interface/Board, and that is why you need to specify the "BdIndex" (or Board Index for the particular GPIB Interface/Board) in the first parameter to ibdev.
Say for instance you have a GPIB Instrument at PAD 3 (but no SAD for which you simply enter "0" to indicate no SAD) that is connected to GPIB1 (its BdIndex = 1), the first 3 parameters in the call to ibdev would look like so:
ibdev(1, 3, 0,...
But if you only have one GPIB Interface/Board in the computer, it is by default set to GPIB0 (its BdIndex = 0), the first 3 parameters to the ibdev call are:
ibdev(0, 3, 0,...
Hopefully this clears it up as to why you need a Board Index along with the Primary Address.
gpibtester