Programming NI-DAQmx and Traditional NI-DAQ (Legacy) Using Visual C# .NET

Publish Date: Feb 13, 2018 | 1 Ratings | 1.00 out of 5 | Print

Overview

This article discusses options for programming NI-DAQmx or Traditional NI-DAQ (Legacy) in Visual C# .NET. It discusses the usefulness of Measurement Studio for Visual Studio.

Table of Contents

  1. Introduction
  2. Using Traditional NI-DAQ (Legacy) ActiveX Controls
  3. Additional Resources

1. Introduction

Measurement Studio for Visual Studio provides a collection of managed .NET and MFC C++ libraries for advanced analysis, scientific user interface controls, and measurement data networking. Measurement Studio also provides code generation and integration tools with Visual Studio. Measurement Studio and NI-DAQmx ship with .NET examples. Please see this White Paper or this KnowledgeBase article for the location and other general information about the examples. It is possible to create a NI-DAQ Application without Measurement Studio.

 Note: MFC C++ libraries are only available for Visual Studio 2003, 2005 and 2008 with Measurement Studio 2009 or earlier. If you are using Visual Studio 2010 or 2012 with MFC C++, please see the NI Measurement Studio for Legacy Environments/Languages product.

Also, National Instruments does not provide native .NET components for Traditional NI-DAQ (Legacy). Measurement Studio support for Visual Studio 2003 and later do not provide additional functionality for developing Traditional NI-DAQ (Legacy) applications. Instead, you can use the Traditional NI-DAQ ActiveX controls to perform data acquisition. The CWDAQ ActiveX control is provided with the Traditional NI-DAQ (Legacy) Driver and does not require Measurement Studio.

Note: NI-DAQmx replaced Traditional NI-DAQ (Legacy) in 2003.  NI strongly recommends using NI-DAQmx for new applications. 


Back to Top

2. Using Traditional NI-DAQ (Legacy) ActiveX Controls

To use the Traditional NI-DAQ (Legacy) ActiveX controls, you must add the CWDAQ ActiveX Controls to the .NET project. Here are the steps to include the controls in the project:

  1. In the .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.

 

For more ideas, you can search on the NI Community for example programs.

 

Back to Top

3. Additional Resources

 

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit