NI Tutorial 4652 En

4
1/4 www.ni.com Using the DAQ Assistant in Measurement Studio 1. 2. 3. 4. 1. 2. 3. 4. 5. Table of Contents Overview Before You Begin Creating a Measurement Studio Visual C# Project  Additional Documentati on The National Instruments Getting Started with NI-DAQmx Series is aimed at helping you learn NI-DAQmx programming fundame ntals. 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 experience d 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 suppo rted by NI-DAQmx. Refer to the file for a list o f devices sup ported by NI-D AQmx. You ma y also create a simulated d evice in Me asurement & NI-DAQ Readme  Automation E xplorer (MAX) in place of an actual data acquisitio n device. Refer to the and the device documentation for information about installing and configuring the software and hardware. DAQ Quick Start Guide Creating a Measurement Studio Visual C# Project To set up the project Open Visual Studio from . Start»All Programs»Microsoft Visual Studio 2005»Mic rosoft Visual Studio 2005 Select . The New Project dialog box launches. File»New»Project In the Project types pane, expand the or node, depending on which language you want to create the project in, and select . Code generation Visual C# Visual Basic Measurement Studio works in both languages. In the Templates pane, select . Specify for and specify a of your choice. Click . The Measurement Studio DAQ NI DAQ Windows Application  MyDAQmxProject Name Location OK  Application Wizard laun ches. 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 . For this walkthrou gh, select and click . .mxb Create a n ew project task Finish : Document Type Tutorial : Yes NI Supported : Sep 23, 2011 Publish Date

Transcript of NI Tutorial 4652 En

Page 1: NI Tutorial 4652 En

7/25/2019 NI Tutorial 4652 En

http://slidepdf.com/reader/full/ni-tutorial-4652-en 1/41/4 www.ni.c

Using the DAQ Assistant in Measurement Studio

1.

2.

3.4.

1.2.

3.

4.

5.

Table of Contents

Overview

Before You Begin

Creating a Measurement Studio Visual C# Project 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 file for a list of devices supported by NI-DAQmx. You may also create a simulated device in Measurement &NI-DAQ Readme

 Automation Explorer (MAX) in place of an actual data acquisition device.

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

Creating a Measurement Studio Visual C# Project

To set up the project

Open Visual Studio from .Start»All Programs»Microsoft Visual Studio 2005»Microsoft Visual Studio 2005Select . The New Project dialog box launches.File»New»Project

In the Project types pane, expand the or node, depending on which language you want to create the project in, and select . Code generationVisual C# Visual Basic Measurement Studio

works in both languages.

In the Templates pane, select . Specify for and specify a of your choice. Click . The Measurement Studio DAQNI DAQ Windows Application   MyDAQmxProject Name Location OK

 Application Wizard launches.

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 a

existing . For this walkthrough, select and click ..mxb Create a new project task Finish

:Document Type Tutorial

: YesNI Supported

: Sep 23, 2011Publish Date

Page 2: NI Tutorial 4652 En

7/25/2019 NI Tutorial 4652 En

http://slidepdf.com/reader/full/ni-tutorial-4652-en 2/42/4 www.ni.c

1.

2.

3.

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

To configure your task

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 as the measurement type foAcquire Signals

your task.

Next, select , then .Analog Input Voltage

From the tree in the tab, select the physical channel, such as , on the DAQ device to which you connected the voltage signal. Click .Supported Physical Channels Physical ai1 Finish

Note  You can also use simulation in this walkthrough. For more information, refer to in theCreating NI-DAQmx Simulated Devices Measurement & Automation Explorer Help

.for NI-DAQmx 

Page 3: NI Tutorial 4652 En

7/25/2019 NI Tutorial 4652 En

http://slidepdf.com/reader/full/ni-tutorial-4652-en 3/43/4 www.ni.c

4.

5.

6.

7.

1.

2.

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 button in the upper-right corneShow Help

the window to display the help.

To complete the DAQ configuration, select the Acquisition Mode in the section of the tab. For more information on timing, refer to in thN Samples Timing Settings Configuration Timing

.NI-DAQmx Help

Next, click the 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 youRun

connected the signal properly. If necessary, you can modify the settings before any code is generated.

Click the 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.Finish

To create a custom user interface for the task

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

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

Page 4: NI Tutorial 4652 En

7/25/2019 NI Tutorial 4652 En

http://slidepdf.com/reader/full/ni-tutorial-4652-en 4/44/4 www.ni.c

 

3.4.

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

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

Additional Documentation

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

 

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 ma

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 US

).http://ni.com/legal/termsofuse/unitedstates/us/