National Instruments none 用户手册

下载
页码 179
Chapter 4
Measurement Studio Integrated Tools and Features
© National Instruments Corporation
4-9
Tip
For more information on how to create an NI-DAQmx user interface, refer to the 
Using a .NET DAQ Component in a Project topic in the NI Measurement Studio Help.
Creating NI-DAQmx User Code in Visual C++
Note
Measurement Studio 8.5 support for Visual Studio 2008 does not include support for 
Visual C++.
You can create NI-DAQmx user code in Visual C++. The DAQmx User 
Code wizard wraps the configured DAQmx task class in a user-friendly 
class and creates a dialog that provides an example of using the new class.
You can use the user code in two different ways. You can call the 
DoModal 
function on the new dialog class, or you can use the user-friendly wrapper 
class directly in your code by calling the class programmatically.
To use the user code directly, create an instance of the DAQmx user code 
class and call the appropriate function in your source code. You can create 
an instance of the user code directly in source code, just as you create an 
instance of any class directly in source code. Declare a variable of the 
appropriate type and use it directly. The 
.h
 file for the user-friendly 
wrapper for the DAQmx task class contains additional information on using 
the user code.
Tip
For more information on how to create user code, refer to the Using a DAQmx Task 
Class in a Project topic in the NI Measurement Studio Help.
Creating an Instrument Control Application
To create a Measurement Studio instrument control application, use the 
Instrument I/O Assistant. The Instrument I/O Assistant, as shown in 
Figure 4-5, integrates into Visual Studio as a code designer. Use the Add 
New Item wizard to add an instrumentation task to your project, and use the 
Instrument I/O Assistant user interface to create and configure the 
instrumentation task. The Instrument I/O Assistant generates a Visual 
Basic .NET, Visual C#, or Visual C++ class that includes the functionality 
you configure in the user interface. Use this assistant to help you write code 
that communicates with devices such as serial, Ethernet, or GPIB 
instruments.
Note
The Instrument I/O Assistant is available only if you have installed either the 
Measurement Studio Professional or Measurement Studio Enterprise package.