Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Measurement Studio GPIB Instrument Drivers

I have spent hours trying to work this one out, trawling through the NI website but cannot find an answer. I have an NI PCI GPIB card, and want to control/retrieve data from a Keithley 2001 DVM. I have purchased Measurement Studio Standard Edition, and Visual Basic.net.
I have tried downloading a driver for the DVM, and wrapped it etc, and it appears in my project. I get a lot of code, but at the top it has :-

'TODO: Could not resolve any constant values; Discarding all constants.

If I try to make reference to any of the commands in the driver it says 'XXX is not declared'

Am I missing a stage out, doing something wrong, or just barking completely up the wrong tree? If so is there a tutorial or example to explain what I am meant to be doing?

Am I downloading the right driver type?

Any help appreciated before I pull all my hair out !

Cheers

Matthew
0 Kudos
Message 1 of 6
(4,875 Views)
Matthew,
I'm sorry to hear you're having trouble using the results of the instrument driver wizard. The Wizard uses several parts of a C instrument driver to build up the wrapper file that it puts in your project. It uses the driver's function panel to determine the driver's interface. It uses the driver's header file to try and resolve any #define'd values the driver uses so that it can inject those constants into the C# or VB.NET class it is trying to create. It looks for that header file in one of three locations: The vxiPnP/include directory, the Ivi/Include directory, and the directory where the function panel you gave it is located. If the driver's .h file is not in one of those locations, or the #defines in the driver refer to other #defines that are in files not in those locations, the driver wizard will not be able to resolve constant values for the driver.

The Driver Wizard tries to take into consideration variations in instrument driver interfaces between older legacy drivers, VxiPnP compliant drivers, and IVI drivers, and attempts to always generate something you can use. However, depending on the interfac to the particular driver you're using, it might not always be what you expect. For instance, if the driver wizard can't find an "_init" funciton that matches its expectations, you won't end up with a constructor and instance methods for driver functionality; instead, you'll get a class with only static methods.

You said you were getting an error of the form 'XXX is not declared' - can you post the exact error message, and let me know when you're getting it? (i.e., is this a compile time error or a run time error?)

Some things that might help debug this a little further:
1) Does the driver have a dll file?
2) What does your code look like where you're calling the driver?
3) Would you be willing to post the wizard-generated file and/or the original driver files (.fp, .sub, .h) - with those, I can try to reproduce your experience here.

Regards,
Glenn Burnside
0 Kudos
Message 2 of 6
(4,873 Views)
Hi, I have the same problme the OP was having. But I never saw a complte resolution to this thread. I'm trying to convert two Network Analyzer VXI Plug 'n' Play drivers over to .Net. I have successfully converted one driver. With the problematic driver I recieve the message:

"// TODO: Could not resolve any constant values; Discarding all constants."

at the top of the generated file. This isn't an error per se, however, I can't use the generated code without the constants so I would have to manually add these...

The driver is for the Agilent 4395A Network Analyzer and can be downloaded here:
http://adn.tm.agilent.com/index.cgi?CONTENT_ID=2281

Sorry if this is excessive but someone may be able to answer my question without the ordeal of downloading, unpacking, etc. Once you've unpacked the download the file structure looks like this:

bin
   | --- hp4395a_32.dll
HP4395A
   | --- hp4395ag.exe
          hp4395ag1.h
          hp4395a.lib
          hp4395a.GID
          hp4395a.hlp
          DeIs1.isu
          hp4395ag.fp
          hp4395a.uir
          readme.txt
          hp4395a.bas
include
   | ---
        hp4395a.h
        hp4395a.bas
lib
   | ---bc
          | --- hp4395a.lib
                hp4395a.lib
        msc
          | --- hp4395a.lib
                 hp4395a_32.lib

Thank you,
Peter

Message Edited by pdrembelas on 03-02-2006 06:33 PM

0 Kudos
Message 3 of 6
(4,645 Views)

Hi Peter,

Sorry you're having trouble with your HP drivers, I think what you're seeing is probably answered in Glenn's post above though.

What may be going on is the .h file I found when I unpacked the included link #defines a lot of constants, but also references userint.h. I only found one copy of this file on my machine, not in the directory structure Glenn mentioned:

"It looks for that header file in one of three locations: The vxiPnP/include directory, the Ivi/Include directory, and the directory where the function panel you gave it is located."

Can you check where this file is on your machine, and if it's not in one of these locations then make a copy of it across?

"If the driver's .h file is not in one of those locations, or the #defines in the driver refer to other #defines that are in files not in those locations, the driver wizard will not be able to resolve constant values for the driver."

Good Luck!

Mark

Applications Engineer

NIUK

0 Kudos
Message 4 of 6
(4,592 Views)

Hi Peter,

 

The link that you posted http://adn.tm.agilent.com/index.cgi?CONTENT_ID=2281 is broke.

Could you give us an other link ?

I am searching for hp4395a_32.dll  

 

Alex

Thanks

0 Kudos
Message 5 of 6
(3,459 Views)

Hi Alex,

 

did you found this dll?

I'm searching also for it.


Please upload it if you have it or give me a link where to find it.

 

Thanks!

0 Kudos
Message 6 of 6
(3,359 Views)