Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 rating:
 1 out of 5     Rate this Document

How Can I Create a .NET Wrapper for My Instrument Driver?

Primary Software: Measurement Studio>>Enterprise Edition (Full Development System)
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I downloaded an instrument driver DLL from the instrument driver network or another location, but I need to use it with my .NET code.  Is there a way to automate the process of wrapping the functions of the DLL so that they are usable in .NET code?

Solution:
You can easily create .NET wrappers for instrument drivers using the Measurement Studio .NET Instrument Driver Wizard.  The tool generates a .NET wrapper class for calling into IVI, VXI, plug & play, and legacy instrument drivers. The tool uses the following three files to generate the wrapper:
  •  the instrument driver function panel (.fp file)
  • header file (.h file)
  • .sub file (only needed for IVI drivers)
The wizard can generate both Visual C# and Visual Basic .NET source code.  To use the wizard, follow the steps pertaining to your version of Measurement Studio:

Measurement Studio Version 7.1 and later:
  1. Create a new windows forms project.  Be sure to include any necessary drivers
  2. Right-click the project and select Add New Item...
  3. In the Add New Item Dialog, select NI Instrument Driver.
  4. Click Add to begin the wizard.  Follow the instructions to create a .NET wrapper
 

Measurement Studio Versions 7.0 and Previous:

  1. In these versions, it is necessary to install the wizard separately.  You can request the wizard for free at the following location:
    Download: Measurement Studio .NET Instrument Driver Wizard
    Note that you will need a valid Measurement Studio 7.0 serial number to receive the installation file
  2. After installing the wizard, run it and follow the on-screen instructions to complete the .NET wrapper
For additional information, refer to the Calling Instrument Drivers from .NET Languages help topic in the NI Measurement Studio Help.

Note: National Instruments Provides .NET wrappers for all of it's Modular Instruments drivers which can be obtained here:
KnowledgeBase 3939UN5B: Microsoft Visual C# and Visual Basic .NET Wrappers for National Instruments Modular Instruments Drivers

Related Links:
KnowledgeBase 3939UN5B: Microsoft Visual C# and Visual Basic .NET Wrappers for National Instruments Modular Instruments Drivers
KnowledgeBase 33C9JM1P: How Do I Use an IVI Driver with Measurement Studio 7.1?
Download: Measurement Studio .NET Instrument Driver Wizard
NI Instrument Driver Network

Attachments:





Report Date: 09/26/2007
Last Updated: 03/18/2010
Document ID: 4DPDIEXU

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit