Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

downloaded the IVI Driver for a DMM, how do I use it in Visual Studio.net

Hello,

   I'm wondering how to use the IVI from NI for say an HP34401A in Visual Studio.net.  I've used the Agilent driver that I downloaded from their site but I wanted to try the NI IVI driver for this same instrument.  However I seem to be having some difficulty.  The software I have is what came with the GPIB-USB-HS.  I understand there is a lot of examples for using it with LabView/Measurement Studio but I'm not interested in all the Active x controls I just want to use the APIs in Visual Studio (preferably C#).

Thanks

0 Kudos
Message 1 of 11
(6,411 Views)

Hello fivealive,
       You will first need to install the current versions of NI-VISA and the IVI Compliance Package, which might have been included in the software that came with your GPIB product.  After you do that, I recommend that you take a look at Using IVI Specific Drivers in Visual Basic .NET, Visual C# or Visual Basic 6 Applications.

Cheers,

NathanT

 
0 Kudos
Message 2 of 11
(6,397 Views)
Hello,

  Thanks for the speedy response. 

It seems like an ADE from NI is necessary to use this.  This is also seen from the link you provided.

For this particular instrument 34401A it says: http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E9419659CE034080020E74861
The bold labels below represent either minimum ADE version or the product requirement which needs to be installed before using this instrument driver. This instrument driver is supported on Win32 systems only.

LabWindows/CVI 6.0

Download hp34401a_setup

LabVIEW 7.1

Download hp34401a_setup

So does this mean I can't use this IVI with just Visual Studio?
0 Kudos
Message 3 of 11
(6,391 Views)
No, an ADE from NI is not necessary. Right below the the CVI and LabVIEW downloads is a link called 'Instructions for Microsoft Visual Basic...'. Having Measurement Studio will make things easier but is not required.
0 Kudos
Message 4 of 11
(6,386 Views)
Hello,

   I'm using C# for visual studio.  I downloaded the evaluation from Measurement studio so that I can get a wrapper for a driver that only had IVI-C.
    So I got Measurement Studio and created a wrapper from .fp file.  I'm wondering how interchangeability can be achieved here. I want to create a logical name that maps to this new driver. 

  1) How do I use this new wrapper created and the Configuration in Max to achieve interchangeability? 

Thanks
Amiel
0 Kudos
Message 5 of 11
(6,281 Views)
How do I get to speak with one of you experts on the phone.  The field agent I got from NI didn't even know what an IVI was. 
0 Kudos
Message 6 of 11
(6,275 Views)

For using .NET environment, I recommend you to use IVI-COM driver from Agilent rather than IVI-C from NI. There is a good Getting Started document at IVI Foundation web site.

http://www.ivifoundation.org/downloads/IVI_GSG_v_1.0.pdf

Plus, if you are trying to access the IVI driver through the IIviDmm interface rather than specific IAgilent34401 interface, I wrote the basic programming step in the following thread.  Although the example code fragment I wrote is C++ smart pointer, the basic approach for using "IVI Session Factory" must be the same even if using .NET language.

http://forums.ni.com/ni/board/message?board.id=140&message.id=29209&query.id=84436#M29209

 

 



このメッセージは 04-24-2008 10:47 AMに Makoto が編集しています。
0 Kudos
Message 7 of 11
(6,257 Views)
Hello,

   Thanks for your reply.  I would love to use the IVI-COM driver and I am aware of how to use it generically using the ivi foundation class.  The problem is that for an instrument that I currently have there is no IVI-COM driver. 

     I'm starting to conclude that there are far more IVI-C drivers than their are IVI-COM drivers.  I'm writing an application that makes no assumptions about power supplies connected to it... i.e vendor/manufacturer...  so I would like to be safe in that we can expect to find a driver for perhaps an old instrument in which my current case there is an ivi-c driver.    The problem is the application is developed in .net using C# with about 2 years of code.

     Is there something I can do to remain in the same framework .net/ c# and use IVI-C drivers.  I will consider any tools NI has as well.  Please advise.

Thanks
fivealive
0 Kudos
Message 8 of 11
(6,238 Views)

hello fivealive,
       If you need interchangeability, you should use the IVI Class driver for your instrument's class.  Since you downloaded an evaluation version of Measurement Studio, I recommend that you take a look at this KB, and create a wrapper around the IVI Class driver for your instrument class.  You will need to also install NI-VISA, which will install MAX, and you will also need to install the IVI Compliance Package.  After those are installed, you will need to install the IVI Specific Driver for your instrument.

Cheers,

NathanT

 
0 Kudos
Message 9 of 11
(6,212 Views)
Hello fivealive,
       Here is an example of how I controlled my DC power supply with the Instrument Driver Wizard generated wrapper around the DCPower Class driver:

            IviDCPwr DC=new IviDCPwr("DCPower", true, false);
            int status = DC.ConfigureVoltageLevel("1", 0.5);
            status = DC.ConfigureOutputEnabled("1", true);
            DC.Dispose();

Then, if I wanted to interchange the instrument, I would:
1.  Install the IVI Specific Driver for my new DC power supply
2.  Open Measurement and Automation Explorer (MAX)
3.  Configure the new instrument's driver session
4.  Change which driver session the logical name ("DCPower") points to
5.  Save the IVI configuration

Cheers,

NathanT
0 Kudos
Message 10 of 11
(6,196 Views)