06-20-2019 05:18 AM
I am working on an XP-based PC running LabWindows/CVI 2013 and I am having difficulties figuring out how to add/change an instrument's GPIB address for use in CVI. I am missing how to link the GPIB address to ibfind() or OpenDev().
The visaconf.ini file seems to have all the info in it but editing the file has no effect on the ability to find the instrument via ibfind() or OpenDev().
How do I make the link between GPIB address and CVI?
TIA, Jerry
06-21-2019 03:40 PM
Hi Jerry,
I recommend downloading the NI-VISA driver compatible with your version of CVI and then start from one of the examples. I think that will be the best way to build up a program that does what you need.
Thanks,
ZofiaK
06-22-2019 02:18 AM
I can't understand exactly what you meant by "linking GPIB address to CVI". GPIB address is some parameter that you input to the ibdev or OpenDev functions. It just have to match the setting on your instrument.
First, when you open NI MAX you need to see your GPIB board in the Devices and Interfaces list on the left. And when you scan the instruments connected to that board, you must be able to see the list of connected instruments.
After that, if you type one of the instrument's address in ibdev or OpenDev, you should be able to get a handle for that instrument. You, then, can send commands and read responses using that handle in ibwrt and ibrd.
06-22-2019 03:41 AM
I wish it was so simple. The original OpenDev() code from 1997 uses names such as "_scope" and "_dmm" for the scope and DMM. The names are in the visaconf.ini file. The OpenDev() command doesn't use the actual GPIB address; only the name. The OS is XP on one system and Win10 on another.
Using CVI 2013/2015 to port the code to the machine. On the Win10 machine, we're not able to read/write any GPIB instrument. How does the c-code know from a name which GPIB address to use? Is the info in visaconf.ini or other table?
TIA, Jerry
06-22-2019 03:49 AM
Actually it is that simple. Using names (they are called "logical names" actually) is just an option, not a must. You can put integer addresses directly and it will work. But you can configure them outside tour program and give names to addresses. You can use NI MAX to assign logical names to addresses.
06-22-2019 08:57 AM
"You can use NI MAX to assign logical names to addresses."
Yes. This is what I need. What application does the logical name assignments? I've looked at all the NI apps on the PC but none seemed to do the logical name assignment. Which program will do the assignments?
I don't want to re-write the code to use actual GPIB addresses as this code is very old and resides in several test platform machines.
06-22-2019 10:52 AM - edited 06-22-2019 10:53 AM
NI Measurement and Automation Explorer = NI MAX
It is a part of the NI VISA installation I think. It is the VISA engine that stores the links between logical names and addresses. VISA was already suggested by NI staff in his/her answer to your post.
06-23-2019 07:58 PM
Thanks. NI MAX didn't seem to do anything to help assign a name to a scope which is referred to in CVI C-code. I'll try again on Monday.
06-24-2019 03:53 AM - edited 06-24-2019 04:02 AM
Duplicate post
06-24-2019 04:01 AM - edited 06-24-2019 04:02 AM
I think there is some misunderstanding.
ibfind is a NI-488 API command and OpenDev() is either a NI-488.2 or LabWindows/CVI specifc API. Both of them work on the NI-488(.2) driver level, not NI-VISA. So trying to setup VISA aliases won't help at all in any way.
Now it has been almost 20 years since I last accessed ibfind and its friends. But I believe there was some way to setup NI-488 aliases too. It's just so damn long ago that I wouldn't know anymore how, and it certainly didn't involve NI-MAX as that didn't exist back then. Use of NI-VISA is so many times easier than the old NI-488.2 API that I never looked back at that.
Most likely NI-MAX is the now sanctioned way to setup such aliases but I'm not sure where that would be. VISA aliases most likely won't be the solution though. Could it be as easy as selecting the instrument entry in the tree on the left hand and then in the properties changing the default name "Instrument 0" to the desired string? Sorry but I do not have any GPIB interface installed on my machines.