Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
43 rating:
 1.95 out of 5   

Programming NI-DAQ in Microsoft Visual Basic .NET

Primary Software:
Primary Software Version: 1.0 Service Pack 1
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Multifunction DAQ (MIO)

What options do I have when programming NI-DAQ in Visual Basic .NET?

Using either the Traditional NI-DAQ or NI-DAQmx driver you can program with NI-DAQ in Visual Basic .NET. With NI-DAQmx you can use Measurement Studio for Visual Studio which provides additional tools for use with NI-DAQmx, though Measurement Studio is not required to use NI-DAQmx in a text-based environment. 

Traditional NI-DAQ
  • National Instruments does not provide native .NET components for Traditional NI-DAQ.
  • You can use the Traditional NI-DAQ ActiveX controls to perform data acquisition. The CWDAQ ActiveX control is provided with the Traditional NI-DAQ Driver and does not require Measurement Studio.
  • You can create a new VB  project and use the ActiveX controls that are installed with Traditional NI-DAQ. To add the CWDAQ ActiveX Controls to a .NET project, complete the following steps:
    1. Inside a .NET project, select View » Toolbox from the pull-down menu.
    2. The Toolbox will appear. Right-click in the toolbox and select Add/Remove Items.
    3. The Customize Toolbox will appear. Select the COM Components tab.
    4. On this tab, you can select the specific CWDAQ control you want to use and click OK.
    5. The control you selected will now show up in the toolbox, where you can drag and drop it onto the form. 
  • National Instruments provides a native .NET API for NI-DAQmx. This is available as a part of the NI-DAQmx driver and does not require Measurement Studio. 
  • If Measurement Studio is installed it will provide support for Visual Studio provides native .NET class libraries and integration and code generation tools for NI-DAQmx and Visual Studio. For example, Measurement Studio 7.0 and later adds the DAQ Assistant for code generation, integrated Visual Studio help, user interface .NET controls, and project wizards.
  • Examples are included with NI-DAQmx and can be found at:

    C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNET<.NET Framework Version> 
    C:\Users\<User Name>\Documents\National Instruments\NI-DAQ\Examples\DotNET<.NET Framework Version> 

    Note: If the paths above do not exist, be sure you have .NET support installed for NI-DAQmx.
  • Additional examples using Measurement Studio and NI-DAQmx are available. These examples are available in the Measurement Studio help and can also be found at:

    C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS<Visual Studio Version>\DotNet\Examples 
    C:\Users\<User Name>\Documents\National Instruments\MStudioVS<Visual Studio Version>\DotNet\Examples
  • For both NI-DAQmx and Measurement Studio examples, sub-folders named vb contain Visual Basic examples.

Related Links:
White Paper: Text Based NI-DAQmx Data Acquisition Examples
White Paper: Using NI-DAQmx in Text Based Programming Environments
Developer Zone Examples: NI Developer Zone Results
KnowledgeBase 317742FQ: Programming NI-DAQ and NI-DAQmx in Text-Based Languages using Visual Studio
KnowledgeBase 3146J6FQ: Archived: Programming NI-DAQ in Visual Basic 6.0
KnowledgeBase 317BPGW3: (Legacy) Programming NI-DAQ in Visual C++ 6.0
KnowledgeBase 317CP7W3: (Legacy)Programming NI-DAQ in Visual C++ .NET (MFC)
KnowledgeBase 3186P9W3: Programming NI-DAQ in Visual C# .NET
Products and Services: NI Measurement Studio


Report Date: 09/08/2003
Last Updated: 12/02/2014
Document ID: 3178NEFQ

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