1. Introduction
Using either the NI-DAQmx or Traditional NI-DAQ (Legacy) driver you can program 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.
2. NI-DAQmx
- 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>
or
C:\Users\<User Name>\Documents\National Instruments\NI-DAQ\Examples\DotNET<.NET Framework Version>
or
C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples
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
or
C:\Users\<User Name>\Documents\National Instruments\MStudioVS<Visual Studio Version>\DotNet\Examples
or
C:\Users\Public\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.
3. Traditional NI-DAQ (Legacy)
- NI-DAQmx replaced Traditional NI-DAQ (Legacy) in 2003. NI strongly recommends using NI-DAQmx for new applications.
- National Instruments does not provide native .NET components for Traditional NI-DAQ (Legacy).
- 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:
- Inside a .NET project, select View » Toolbox from the pull-down menu.
- The Toolbox will appear. Right-click in the toolbox and select Add/Remove Items.
- The Customize Toolbox will appear. Select the COM Components tab.
- On this tab, you can select the specific CWDAQ control you want to use and click OK.
- The control you selected will now show up in the toolbox, where you can drag and drop it onto the form.
4. Additional Resources
- Text Based NI-DAQmx Data Acquisition Examples
- Using NI-DAQmx in Text Based Programming Environments
- Programming NI-DAQmx and Traditional NI-DAQ (Legacy) using Visual Studio
- Programming NI-DAQmx or Traditional NI-DAQ (Legacy) in Visual C# .NET
- Archived: Programming NI-DAQmx and Traditional NI-DAQ (Legacy) in Visual Basic 6.0
- Archived: Programming NI-DAQmx or Traditional NI-DAQ (Legacy) in Visual C++ 6.0
- Archived: Programming Traditional NI-DAQ (Legacy) in Visual C++ MFC
- Using the Measurement Studio NI-DAQmx .NET Library