Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Error initializing DMM with OpenDev

When initializing a Keithley 2000 DMM through GPIB using the OpenDev command it returns an invalid number.  Checking the NI instrument explorer and querying the DMM shows an active connection.  Failing code below.
 
    /*  Initialize the GPIB interface.  */
    if (bd[instrID] <= 0)  {
        if (instr_cnt <= 1)
            CloseInstrDevs ("kei2001");
        bd[instrID] = OpenDev ("kei2001", "kei2001");
        if (bd[instrID] <= 0)  {
            kei2001_err = 220;
            return kei2001_err;
        }
    }
0 Kudos
Message 1 of 7
(4,349 Views)
Hi BlueBirdHouse,

I wanted to get a little more information from you on this.

What version of NI-VISA are you using?
What version of NI-488.2 do you have installed?
Can you see this device in MAX? Can you query this device within MAX?
What operating system are you working with?

Regards,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 2 of 7
(4,333 Views)
Matt_S,
 
Thanks for your reply, I'm currently running:
NI-VISA v1.1.04
NI-488.2 v3.0
MAX sees and successfully queries the DMM
OS Win XP
 
Let me know if there's anything else you want to know.
0 Kudos
Message 3 of 7
(4,330 Views)
Hmm, we may be having some versioning issues.

A) Uninstall 488.2 and NI-VISA
B) Install NI-VISA v. 3.3.1  from

http://digital.ni.com/softlib.nsf/websearch/CC5A993FEFA83D498625704600677AE7?opendocument&node=132070_US

C) Install 488.2 v 2.4 from

http://digital.ni.com/softlib.nsf/websearch/1DDE5C48F30C2C658625702000681295?opendocument&node=132060_US

I'm not sure why you would be seeing 4882. v3.0, version 2.4 is the latest version out.

Once you get these installed, we'll at least be sure that we're not having problems caused by old driver versions.

-Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 4 of 7
(4,327 Views)

I'm sorry, I was mistaken.  488.2 is v2.2 and VISA is v3.1

I have a simular system with identical drivers that is currently working, but I'll install the new drivers on the non-functioning one if you still think it might help.

0 Kudos
Message 5 of 7
(4,325 Views)
The problem has been solved, the file C:\Windows\system32\GPIB.ini had the device names set to default (DEV1, DEV2, etc.) instead of "kei2001" as specified in my code.  Correcting that solved the communications problem.
 
As a note to NI, I think the problem would have been easier to solve if I could have looked at the code for the OpenDev function, so making that code available or more easily accessible would be nice.
0 Kudos
Message 6 of 7
(4,314 Views)

Thanks Bluebird, I was also getting errors with OpenDev.

 

As a further note to NI I think it would be helpful if a search of the LabWindows and 488.2 help for GPIB.ini actually found something. None of the documentation for OpenDev mentions that it is dependent on the GPIB.ini file.

0 Kudos
Message 7 of 7
(4,107 Views)