Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Sep 23, 2011


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links -Products and Services

Using the DAQ Assistant in Measurement Studio

11 Ratings | 2.82 out of 5
Read in  |  Print |  PDF

Table of Contents

  1. Overview
  2. Before You Begin
  3. Creating a Measurement Studio Visual C# Project
  4. Additional Documentation

The National Instruments Getting Started with NI-DAQmx Series is aimed at helping you learn NI-DAQmx programming fundamentals. Through video and text tutorials, this series will take you from verifying your device's operation in Measurement & Automation Explorer (MAX) to programming data acquisition applications using LabVIEW. It is intended for both the beginner who wants to learn how to use the DAQ Assistant, as well as the experienced user who wishes to take advantage of advanced NI-DAQmx functionality.

Overview

This tutorial explains how to use the DAQ Assistant to quickly develop and deploy a Visual Studio application that uses data acquisition and Measurement Studio. The DAQ Assistant is an easy-to-use graphical interface for configuring measurement tasks and channels and for customizing timing, triggering, and scales without programming. Using the DAQ Assistant, you can configure a measurement task for all of your data acquisition applications and then generate code to configure and use the task in your application program. 

 

Before You Begin

To use this tutorial, you must have the following software and hardware installed on your system:

  • Visual Studio 2005/2008
  • Measurement Studio 8.0.1 or later (Professional or Enterprise package)
  • NI-DAQmx 8.1 or later
  • A DAQ device that is supported by NI-DAQmx. Refer to the NI-DAQ Readme file for a list of devices supported by NI-DAQmx. You may also create a simulated device in Measurement & Automation Explorer (MAX) in place of an actual data acquisition device. 


Refer to the DAQ Quick Start Guide and the device documentation for information about installing and configuring the software and hardware.

Creating a Measurement Studio Visual C# Project

To set up the project

  1. Open Visual Studio from Start»All Programs»Microsoft Visual Studio 2005»Microsoft Visual Studio 2005.
  2. Select File»New»Project. The New Project dialog box launches.
  3. In the Project types pane, expand the Visual C# or Visual Basic node, depending on which language you want to create the project in, and select Measurement Studio. Code generation works in both languages.
  4. In the Templates pane, select NI DAQ Windows Application. Specify MyDAQmxProject for Name and specify a Location of your choice. Click OK. The Measurement Studio DAQ Application Wizard launches.

  5. In the Add DAQ Component dialog box, you can choose to create a new project task, create a new MAX task, create a reference to a MAX task, copy a MAX task to a project task, or copy an existing .mxb. For this walkthrough, select Create a new project task and click Finish.

    The Measurement Studio DAQ Application Wizard automatically sets up your data acquisition project and launches the DAQ Assistant.

To configure your task

  1. In the Create New CVI/MS Project-Based Task dialog box of the DAQ Assistant, you can begin to interactively define your DAQ task. Select Acquire Signals as the measurement type for your task.
  2. Next, select Analog Input, then Voltage.


  3. From the Supported Physical Channels tree in the Physical tab, select the physical channel, such as ai1, on the DAQ device to which you connected the voltage signal. Click Finish.
    Note    You can also use simulation in this walkthrough. For more information, refer to Creating NI-DAQmx Simulated Devices in the Measurement & Automation Explorer Help for NI-DAQmx.

  4. Using the DAQ Assistant, you can edit the configuration of your DAQ task. If the embedded DAQ Assistant help is not open by default, click the Show Help button in the upper-right corner of the window to display the help.
  5. To complete the DAQ configuration, select the N Samples Acquisition Mode in the Timing Settings section of the Configuration tab. For more information on timing, refer to Timing in the NI-DAQmx Help.

  6. Next, click the Run button in the toolbar near the top of the Edit DAQ Task dialog box. The test runs automatically. You can run the project task test in the DAQ Assistant to make sure you connected the signal properly. If necessary, you can modify the settings before any code is generated.

  7. Click the Finish button in the Edit DAQ Task dialog box to complete the configuration of your DAQ task and to launch the Configure DAQ Component UI wizard.

To create a custom user interface for the task

  1. In the Configure DAQ Component UI wizard, you can customize and preview a user interface and code for your task.

  2. Click Finish to generate the task user interface in your project form.

    The wizard also generates event handlers and code to acquire data and present it on your generated user interface.

  3. Press <F5> to run the application.
  4. After you have started the application, click the Read button to begin acquiring data from your DAQ device.

Additional Documentation

To learn more about tasks, channels, and other NI-DAQmx concepts, refer to the NI-DAQmx Help located at Start»All Programs»National Instruments»NI-DAQ»NI-DAQmx Help.

 

11 Ratings | 2.82 out of 5
Read in  |  Print |  PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).