Copyright: NI-DAQ Examples On-Line Help for NI-DAQ Version 6.7
Citation: Copyright (c)2000, National Instruments Corp. All Rights Reserved. Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation.


NIDAQ Examples On-Line Help
NI-DAQ Examples OnLine Help

Contents

List of Examples By Category

List of Examples By Task Type

List of Examples By NI-DAQ Functions Used

Instructions

About these examples

Steps on how to use these examples

Reference

NI-DAQ Example Utility Functions

NIDAQDelay

NIDAQErrorHandler

NIDAQMakeBuffer

NIDAQMean

NIDAQPlotWaveform

NIDAQWaitForKey

NIDAQYield

Other Help Files

NI-DAQ Function Reference Manual


List of Examples By Category

Jump to: Analog Input - Analog Output - Digital Input - Digital Output - Calibration - Counter - SCXI - DAQ Event

For further information about each example, please refer to the List of Examples by Task Type, List of Examples By NI-DAQ Functions Used, or header section of the examples themselves.

NOTE:	The filename extensions are omitted because the same example exists in each of the supported programming languages.
AI: Analog Input Examples

Click here to get a list of analog input examples.

These examples are in the .\AI subdirectory.

AO: Analog Output Examples

Click here to get a list of analog output examples.

These examples are in the .\AO subdirectory.

DI: Digital Input Examples

Click here to get a list of digital input examples.

These examples are in the .\DI subdirectory.

DO: Digital Output Examples

Click here to get a list of digital output examples.

These examples are in the .\DO subdirectory.

CALIB: Calibration Examples

Click here to get a list of calibration examples.

These examples are in the .\CALIB subdirectory.

CTR: Counter Examples

Click here to get a list of counter examples.

These examples are in the .\CTR subdirectory.

NOTE:	DAQ-STC-based counter examples have filenames beginning with “STC”. NI-TIO-based counter examples have filenames beginning with “TIO”. 8253-based counter examples have filenames beginning with “8253”. Am9513-based counter examples have filenames beginning with “9513”.
NOTE:	In general, DAQ-STC based counter examples will work on NI-TIO based devices with a few modifications, such as changing counter numbers and PFI pin numbers.  Some NI-TIO based counter examples, such as buffered event counting (single-or circular buffered) will work on DAQ-STC based devices with a few modifications, such as changing counter numbers and PFI pin numbers.
SCXI: Examples using SCXI™ equipment

Click here to get a list of SCXI examples.

These examples are in the .\SCXI subdirectory.

EVENT: DAQ Event Examples

Visual Basic Only:  These examples are in the .\EVENT directory.

EVENT\Event1 (Please refer to the source code for details.)


List of Examples By Task Type

Jump to: Number of Points - Number of Channels - Duration of Operations - Timing of Operations - Triggering of Operations - Counter/Timer Operations - Other Task Types

For further information about each example, please refer to the List of Examples by Category, List of Examples By NI-DAQ Functions Used, or header section of the examples themselves.

NOTE:	The filename extensions are omitted because the same example exists in each of the supported programming languages.
Number of Points

1PT: Single-point Examples

Single-point examples take one measurement at a time without using a buffer.

Click here to get a list of examples.

BUF: Buffered examples

Buffered examples use an acquisition/generation buffer to store multiple data points.

Click here to get a list of examples.

Number of Channels

1ch: Single-channel examples

Single-channel examples operate only on a single channel, port, or line.

Click here to get a list of examples.

Nch: Multiple-channel examples

Multiple-channel examples operate on a more than one channel, port, or line.

Click here to get a list of multiple-channel examples.

Duration of Operations

BURST: Burst-type examples

Burst-type examples operate on a single burst and a finite number of data points.

Click here to get a list of examples.

CONT: Continuous examples

Continuous examples use function calls that allow operations of infinite duration.

Click here to get a list of examples.

Timing of Operations

IMMED: Immediate operation examples

Immediate operation examples operate on data points immediately.

Click here to get a list of examples.

ASYNC: Examples using asynchronous NI-DAQ functions

Asynchronous operations contain function calls that returns immediately after starting a background operation.

Click here to get a list of examples.

SYNC: Examples using synchronous NI-DAQ functions

Synchronous operations contain function calls that perform operations in the foreground, that is, they stay in the function until the operation is complete.

Click here to get a list of examples.

INTTIM: Examples based on internal (hardware) timing

Internally timed operations use an on-device clock to time the sample or update operation.

Click here to get a list of examples.

EXTTIM: Examples based on external (hardware) timing

Externally timed operations use an external clock to time the sample or update operation.

Click here to get a list of examples.

Triggering of Operations

INTTRIG: Examples using internal triggering

Internally triggered operations use an internal (or software) trigger to initiate the operation.

Click here to get a list of examples.

EXTTRIG: Examples using external or start triggering

Externally triggered operations use an external trigger signal to initiate the operation.

Click here to get a list of examples.

STOPTRIG: Examples using stop triggering

Stop-triggered (pre-triggered) operations use an external trigger to stop the operation, and allows you to retrieve the data before and after the trigger.

Click here to get a list of examples.

PATTRIG: Examples using pattern-based triggering

Pattern-based triggering operations use a digital pattern to initiate the operation.

Click here to get a list of examples.

ATRIG: Examples using analog triggering

Analog triggering operations use an analog signal at a desired slope and level to initiate the operation.

Click here to get a list of examples.

Counter/Timer Operation Types

EVENTCNT: Event-counting examples

Event counting operation examples count events (pulses).

Click here to get a list of examples.

FREQM: Frequency measurement examples

Frequency measurement operation examples measures frequency.

Click here to get a list of examples.

PLSTRN: Pulse train generation examples

Pulse train generation operation examples generate pulse trains.

Click here to get a list of examples.

PLSWM: Pulse-width measurement examples

Pulse-width measurement operation examples measure pulse widths.

Click here to get a list of examples.

PERM: Period measurement examples

Period measurement operation examples measure pulse periods.

Click here to get a list of examples.

Other Task Types

ESER: Examples that work only on E-Series devices

These examples require an E-Series device or a device with similar capabilities and/or features.

Click here to get a list of examples.

DISK: Examples that either read from or write to a disk file

These examples accesses the disk drive of your computer for data storage.

Click here to get a list of examples.

HANDSHK: Examples that use digital handshaking

These examples perform digital handshaking.

Click here to get a list of examples.


List of Examples By Functions
List of Examples By NI-DAQ Functions Used

Jump to: A - C - D - G - I - L - M - R - S - T - W

For further information about each example, please refer to the List of Examples by Category, List of Examples By Task Type, or header section of the examples themselves.

NOTE:	The filename extensions are omitted because the same example exists in each of the supported programming languages.
NOTE:	Some of these functions may not be used in any of the examples.
A

AI_Change_Parameter

Click here to get a list of examples.

AI_Check

Click here to get a list of examples.

AI_Clear

Click here to get a list of examples.

AI_Configure

Click here to get a list of examples.

AI_Get_Overloaded_Channels

Click here to get a list of examples.

AI_Mux_Config

Click here to get a list of examples.

AI_Read

Click here to get a list of examples.

AI_Read_Scan

Click here to get a list of examples.

AI_Setup

Click here to get a list of examples.

AI_VRead

Click here to get a list of examples.

AI_VRead_Scan

Click here to get a list of examples.

AI_VScale

Click here to get a list of examples.

Align_DMA_Buffer

Click here to get a list of examples.

AO_Calibrate

Click here to get a list of examples.

AO_Change_Parameter

Click here to get a list of examples.

AO_Configure

Click here to get a list of examples.

AO_Update

Click here to get a list of examples.

AO_VScale

Click here to get a list of examples.

AO_VWrite

Click here to get a list of examples.

AO_Write

Click here to get a list of examples.

C

Calibrate_1200

Click here to get a list of examples.

Calibrate_DSA

Click here to get a list of examples.

Calibrate_E_Series

Click here to get a list of examples.

Config_Alarm_Deadband

Click here to get a list of examples.

Config_ATrig_Event_Message

Click here to get a list of examples.

Config_DAQ_Event_Message

Click here to get a list of examples.

Configure_HW_Analog_Trigger

Click here to get a list of examples.

CTR_Config

Click here to get a list of examples.

CTR_EvCount

Click here to get a list of examples.

CTR_EvRead

Click here to get a list of examples.

CTR_FOUT_Config

Click here to get a list of examples.

CTR_Period

Click here to get a list of examples.

CTR_Pulse

Click here to get a list of examples.

CTR_Rate

Click here to get a list of examples.

CTR_Reset

Click here to get a list of examples.

CTR_Restart

Click here to get a list of examples.

CTR_Simul_Op

Click here to get a list of examples.

CTR_Square

Click here to get a list of examples.

CTR_State

Click here to get a list of examples.

CTR_Stop

Click here to get a list of examples.

D

DAQ_Check

Click here to get a list of examples.

DAQ_Clear

Click here to get a list of examples.

DAQ_Config

Click here to get a list of examples.

DAQ_DB_Config

Click here to get a list of examples.

DAQ_DB_HalfReady

Click here to get a list of examples.

DAQ_DB_Transfer

Click here to get a list of examples.

DAQ_Monitor

Click here to get a list of examples.

DAQ_Op

Click here to get a list of examples.

DAQ_Rate

Click here to get a list of examples.

DAQ_Set_Clock

Click here to get a list of examples.

DAQ_Start

Click here to get a list of examples.

DAQ_StopTrigger_Config

Click here to get a list of examples.

DAQ_to_Disk

Click here to get a list of examples.

DAQ_VScale

Click here to get a list of examples.

DIG_Block_Check

Click here to get a list of examples.

DIG_Block_Clear

Click here to get a list of examples.

DIG_Block_In

Click here to get a list of examples.

DIG_Block_Out

Click here to get a list of examples.

DIG_Block_PG_Config

Click here to get a list of examples.

DIG_DB_Config

Click here to get a list of examples.

DIG_DB_HalfReady

Click here to get a list of examples.

DIG_DB_Transfer

Click here to get a list of examples.

DIG_Grp_Config

Click here to get a list of examples.

DIG_Grp_Mode

Click here to get a list of examples.

DIG_Grp_Status

Click here to get a list of examples.

DIG_In_Grp

Click here to get a list of examples.

DIG_In_Line

Click here to get a list of examples.

DIG_In_Prt

Click here to get a list of examples.

DIG_Line_Config

Click here to get a list of examples.

DIG_Out_Grp

Click here to get a list of examples.

DIG_Out_Line

Click here to get a list of examples.

DIG_Out_Prt

Click here to get a list of examples.

DIG_Prt_Config

Click here to get a list of examples.

DIG_Prt_Status

Click here to get a list of examples.

DIG_SCAN_Setup

Click here to get a list of examples.

DIG_Trigger_Config

Click here to get a list of examples.

G

Get_DAQ_Device_Info

Click here to get a list of examples.

Get_NI_DAQ_Version

Click here to get a list of examples.

GPCTR_Change_Parameter

Click here to get a list of examples.

GPCTR_Config_Buffer

Click here to get a list of examples.

GPCTR_Control

Click here to get a list of examples.

GPCTR_Read_Buffer

Click here to get a list of examples.

GPCTR_Set_Application

Click here to get a list of examples.

GPCTR_Watch

Click here to get a list of examples.

I

ICTR_Read

Click here to get a list of examples.

ICTR_Reset

Click here to get a list of examples.

ICTR_Setup

Click here to get a list of examples.

Init_DA_Brds

Click here to get a list of examples.

L

Lab_ISCAN_Check

Click here to get a list of examples.

Lab_ISCAN_Op

Click here to get a list of examples.

Lab_ISCAN_Start

Click here to get a list of examples.

Lab_ISCAN_to_Disk

Click here to get a list of examples.

Line_Change_Attribute

Click here to get a list of examples.

LPM16_Calibrate

Click here to get a list of examples.

M

MIO_Config

Click here to get a list of examples.

R

RTSI_Clear

Click here to get a list of examples.

RTSI_Clock

Click here to get a list of examples.

RTSI_Conn

Click here to get a list of examples.

RTSI_DisConn

Click here to get a list of examples.

S

SC_2040_Config

Click here to get a list of examples.

SCAN_Demux

Click here to get a list of examples.

SCAN_Op

Click here to get a list of examples.

SCAN_Sequence_Demux

Click here to get a list of examples.

SCAN_Sequence_Retrieve

Click here to get a list of examples.

SCAN_Sequence_Setup

Click here to get a list of examples.

SCAN_Setup

Click here to get a list of examples.

SCAN_Start

Click here to get a list of examples.

SCAN_to_Disk

Click here to get a list of examples.

SCXI_AO_Write

Click here to get a list of examples.

SCXI_Cal_Constants

Click here to get a list of examples.

SCXI_Calibrate_Setup

Click here to get a list of examples.

SCXI_Change_Chan

Click here to get a list of examples.

SCXI_Configure_Filter

Click here to get a list of examples.

SCXI_Get_Chassis_Info

Click here to get a list of examples.

SCXI_Get_Module_Info

Click here to get a list of examples.

SCXI_Get_State

Click here to get a list of examples.

SCXI_Get_Status

Click here to get a list of examples.

SCXI_Load_Config

Click here to get a list of examples.

SCXI_ModuleID_Read

Click here to get a list of examples.

SCXI_MuxCtr_Setup

Click here to get a list of examples.

SCXI_Reset

Click here to get a list of examples.

SCXI_Scale

Click here to get a list of examples.

SCXI_SCAN_Setup

Click here to get a list of examples.

SCXI_Set_Config

Click here to get a list of examples.

SCXI_Set_Gain

Click here to get a list of examples.

SCXI_Set_Input_Mode

Click here to get a list of examples.

SCXI_Set_State

Click here to get a list of examples.

SCXI_Set_Threshold

Click here to get a list of examples.

SCXI_Single_Chan_Setup

Click here to get a list of examples.

SCXI_Track_Hold_Control

Click here to get a list of examples.

SCXI_Track_Hold_Setup

Click here to get a list of examples.

Select_Signal

Click here to get a list of examples.

Set_DAQ_Device_Info

Click here to get a list of examples.

T

Timeout_Config

Click here to get a list of examples.

W

WFM_Chan_Control

Click here to get a list of examples.

WFM_Check

Click here to get a list of examples.

WFM_ClockRate

Click here to get a list of examples.

WFM_DB_Config

Click here to get a list of examples.

WFM_DB_HalfReady

Click here to get a list of examples.

WFM_DB_Transfer

Click here to get a list of examples.

WFM_from_Disk

Click here to get a list of examples.

WFM_Group_Control

Click here to get a list of examples.

WFM_Group_Setup

Click here to get a list of examples.

WFM_Load

Click here to get a list of examples.

WFM_Op

Click here to get a list of examples.

WFM_Rate

Click here to get a list of examples.

WFM_Scale

Click here to get a list of examples.

WFM_Set_Clock

Click here to get a list of examples.


Instructions
Instructions: About these examples

The NI-DAQ Examples are designed to show how a certain DAQ task is to be done using the NI-DAQ Applications Programming Interface (API).

All programs are written without any extra user interface related function calls, so that you can easily follow the flow of NI-DAQ functions used.

Here are some of the unique features of the NI-DAQ Examples:

Using NI-DAQ Functions to Perform a Simple Data Acquisition Task

In the NI-DAQ Examples, there are:

	no unnecessary user interface related function calls included
	no branching of the code based on the DAQ device you are using

Because the extra function calls have been stripped out, you can easily see how NI-DAQ API functions are to be sequenced to perform a certain task.

The filename extensions are omitted since the same example exists in each of the supported programming languages.

NOTE:	The Visual Basic examples have been placed in a "shell" form, which has a "Do Operation" Button.  The sequence of NI-DAQ function calls in the handler function for "Do Operation" is the same as the sequence used in a C program with only a "main" procedure.
Standardized Header Section

The comment section in the beginning of the source code for all of these examples have the following common items:

	Title of example
	Short description of what the example does
	Example Category and Task Types These are key words to identify the task exemplified.
	List of key parameters A key parameter is a parameter that enables the task at hand.   For instance, the extTrig parameter in the DAQ_Config function is a key parameter, since if you set it to 1, the DAQ device will start acquisition upon an external digital trigger.
	List of NI-DAQ functions used in the example You can identify at a glance which NI-DAQ functions are used in the example to refer to the other NI-DAQ documentation.   HINT: Use this section in conjunction with the NI-DAQ On-Line Help or the NI-DAQ Function Reference Manual for PC Compatibles (PDF format) to identify which DAQ devices support the NI-DAQ functions used in the example.
	Pin Connection Information You can find out what signals to connect to which I/O connector pins to make the example work.  Some examples might require other signal sources, such as a digital trigger signal or a digital pulse train.  These requirements are all mentioned in this section.  The actual pin numbers have been omitted to maintain the simplicity of this header section.   In some cases, such as examples specifically tailored for the E-Series devices, you might see specific pin names.  In other cases, you might see the name of a type of an I/O connector pin, since the pin names differ between devices.
Hardcoded Variables for Simplified Program Flow

All variables used for the NI-DAQ function parameters are declared in the same procedure, so you can see what values have been assigned to them without navigating through the source code.   Array variables are declared as static to avoid allocating large amounts of stack space to a local variable.


How to use these examples
Instructions: How to use these examples

LabWindows/CVI

Visual C++

Visual Basic

Borland C++

How to Use These Examples in LabWindows/CVI

Simply load the .PRJ file you want into the LabWindows/CVI Interactive Development Environment.  These .PRJ files are compatible with LabWindows/CVI versions 3.1 and above.

To run the program, click on the Run button in the LabWindows/CVI Interactive Development Environment.

How to Use These Examples in Visual C++

You must first build the programs using the provided .MAK files before running the examples.  To ensure compatibility between Visual C++ 2.x and Visual C++ 6.x, there are no .MDP files for Visual C++ 4.x nor .DSP files for Visual C++ 5.0 and 6.0.

NOTE:	Before building, please make sure that the path to your Visual C++ compiler is in the system’s PATH and that the INCLUDE and LIB environmental variables are set correctly as well.  To verify these, simply type SET at the command prompt.  To setup Visual C++ environment variables, first open a DOS Command Prompt box (with the Properties >> Memory >> Initial environment size set to at least 4096), and then go to the "bin" directory under your Visual C++ directory (e.g.: c:\Microsoft Visual Studio\vc98\bin), and type VCVARS32.BAT.  Then proceed with the instructions below.

Run the Microsoft Build Utility NMAKE from the command prompt on the .MAK file you want as such:

nmake <makefile>.mak

In the .MAK file, the .C file is compiled and the generated .OBJ file is linked with the NI-DAQ Import Library and the NI-DAQ Examples Utility Import Library:

	In 32-bit Visual C++, the .C file is compiled and linked with NIDAQ32.LIB and NIDEX32.LIB to create a Console application.
How to Use These Examples in Visual Basic

	In Windows 95 or Windows NT (Visual Basic version 4.0 or later; 32-bit only):
Load the .VBP file you want into the Visual Basic Interactive Development Environment.

To run the program, click on the Run button in the Visual Basic Interactive Development Environment.

	The Visual Basic project files (.VBP) are for Visual Basic 4.0 (32-bit), however, you can use these project files with later versions of Visual Basic (5.0, 6.0, etc.)  When you see Visual Basic display a dialog box stating that the project was made for an older version, simply click "Ok for all" and continue.
How to Use These Examples in Borland C++

There are no .PRJ or .IDE files included for Borland C++ examples.  However, each .C file has a corresponding .BAT file which you can run to create the corresponding .EXE.

<progname>.bat [/?]

For example, if you want to make AI1pt.EXE, type this at the command prompt:

AI1pt.bat

The batch file assumes that your Borland C++ directory is at a certain path.  This is set in the batch file as an environment variable BorlandDir.  To change the BorlandDir path, simply edit the line in the batch file that says:

set BorlandDir=<path>

To find tips on how to run the example in the Borland C++ Interactive Development Environment (IDE), you can use the /? flag on the batch file when running it from the command prompt.  For example:

AI1pt.bat /?

In the .BAT file, the .C file is compiled and the generated .OBJ file is linked with the NI-DAQ Import Library (for Borland C++) and the NI-DAQ Examples Utility Import Library (for Borland C++):

	In 32-bit Borland C++, the .C file is compiled and linked with NIDAQ32B.LIB and NIDEX32B.LIB to create a Console application.
	The libraries specified in the batch file are for Borland C++ version 5.0.  If you are using a newer version of Borland C++ or C++ Builder, please modify the list of libraries, or make a C++ project file (.IDE).  Hints are given when you run the batch file with the "/?" flag, as shown above.


Reference

NI-DAQ Example Utility Functions

The following functions are offered as Example Utility Functions and are used in the NI-DAQ Example Programs.

NIDAQDelay

NIDAQErrorHandler

NIDAQMakeBuffer

NIDAQMean

NIDAQPlotWaveform

NIDAQWaitForKey

NIDAQYield

For LabWindows/CVI, these are placed in a source code file called NIDAQEX.C.

For other Windows programming languages, these are placed in NIDEX32.DLL for 32-bit applications.  For your convenience, a static import library is included in the LIB directory in your NI-DAQ for Windows directory.

To use these functions:

	To use these functions with LabWindows/CVI, you must include the NIDAQEX.H header file and the NIDAQEX.C file in your project.
	To use these functions with 32-bit Visual C++, you must include the NIDAQEX.H header file and link in the NIDEX32.LIB import library.
	To use these functions with 32-bit Borland C++, you must include the NIDAQEX.H header file and link in the NIDEX32B.LIB import library.
	To use these functions with 32-bit Visual Basic, you must include the NIDEX32.BAS file in your project.
NIDAQDelay

Format

status = NIDAQDelay(sec)

Purpose

To make wait a specified duration in the foreground task. This function does not use any DAQ hardware).

Parameters

Input

Name	Type	Description
sec	F64	Duration in seconds to delay

Return Type

Name	Type	Description
status	I16	Status code (not used)

Parameter Discussion

sec is the number of seconds to delay.  It must be positive.

status is the return code of this function.  This function simply return a zero.

Using This Function

Use the function to place a short delay in the program flow.

In LabWindows/CVI, this function simply calls the delay function.

In the DLL, this function calls time functions and loops until the desired time is elapsed.

NIDAQErrorHandler

Format

status = NIDAQErrorHandler(daqStatus, functionName, ignoreWarning)

Purpose

To display a message dialog box with the NI-DAQ error/warning code and a description, and an option for the user to continue (continue option not available in LabWindows/CVI).

Parameters

Input

Name	Type	Description
daqStatus	I16	Status code returned from NI-DAQ function
functionName	STR	Function name associated with status code
ignoreWarning	I16	Flag to turn warning code checking on or off

Return Type

Name	Type	Description
status	I16	Status code from MessageBox function

Parameter Discussion

daqStatus is the status code returned from the NI-DAQ function used right before this function.

functionName is a string that identifies the function associated with the status code.

ignoreWarning specifies whether to ignore NI-DAQ status codes that are positive (NI-DAQ Warnings) or not.  To ignore the warnings, set this parameter to 1.

status is the return code of this function.  Possible return codes are the same as the following functions:

CVI:	MessagePopup

DLL:	MessageBox (Windows API)

Using This Function

Use the function to check if the NI-DAQ function returned an error or warning code.  The error codes are negative, and the warning codes are positive.  It is recommended that you check errors after every single NI-DAQ function.

In the DLL version of NIDAQErrorHandler, you can determine which button was pressed in the dialog box by examing the returned status code.  For example, if the No button was pressed, then this function will return ID_NO.  And if the Yes button was pressed, this function will return ID_YES.

NIDAQMakeBuffer

Format

status = NIDAQMakeBuffer(buffer, count, dataType)

Purpose

To make an arbitrary buffer for use with NI-DAQ functions that perform an output task.

Parameters

Input

Name	Type	Description
count	U32	Number of elements desired
dataType	U32	Datatype desired

Output

Name	Type	Description
buffer	VOID*	Buffer to be filled (memory must be allocated first)

Return Type

Name	Type	Description
status	I16	Status Code

Parameter Discussion

count is the number of elements that you want placed into the buffer.

dataType is the code for the type of data you want in the buffer.  Allowed values are:

WFM_DATA_U8 (0):	unsigned 8-bit data

WFM_DATA_I16 (2):	signed 16-bit data

WFM_DATA_F64 (4):	double precision 64-bit data

These constants are defined in the NI-DAQ Examples Utility Function header files (see above).

buffer is the pointer to the allocated memory space for the buffer.

	If you are programming in C/C++, make sure you typecast this parameter as void* and allocate this memory space before you call this function.
	If you are programming in Visual Basic, declare this buffer as an array of the datatype you want.  The WFM_DATA_U8 type will have data interlaced in the lower and upper bytes of an Integer datatype.

status is the return code of this function.  Possible return codes are:

NIDAQEX_INVALID_BUFFER (-12): buffer is invalid.

NIDAQEX_INVALID_NUMPTS (-14): count is invalid.

NIDAQEX_INVALID_TYPE (-53): datatype code is invalid.

These return codes are compatible with the return codes used in LabWindows/CVI.

Using This Function

Use this function to create buffers of different data types.

When you select the WFM_DATA_U8 type, the buffer will contain a ramp from 0 to 255.  If there are more than 256 elements in the buffer, the same pattern will repeat.  This is useful for buffered digital output operations.

When you select the WFM_DATA_I16 type, the buffer will contain a 10-period squarewave, alternating between the values 0 and 2047.  This is useful for analog output waveform generaion operations, where the each data element must be specified as a short integer (binary).

When you select the WFM_DATA_F64 type, the buffer will contain a 10-period sinewave, ranging between the values 0.00 and 4.99.  This is useful for analog output waveform generaion operations, where the data must be specified as "double-precision" (scaled).

NIDAQMean

Format

status = NIDAQMean(buffer, count, dataType, mean)

Purpose

To calculate the arithmetic mean of the numbers in a data array.

Parameters

Input

Name	Type	Description
buffer	VOID*	Data buffer
count	U32	Number of elements
dataType	U32	Datatype

Output

Name	Type	Description
mean	F64	Arithmetic mean (average)

Return Type

Name	Type	Description
status	I16	Status Code

Parameter Discussion

buffer is the pointer to the allocated memory space for the buffer.

	If you are programming in C/C++, make sure you typecast this parameter as void* and allocate this memory space before you call this function.
	If you are programming in Visual Basic, declare this buffer as an array of the datatype you want.  The WFM_DATA_U8 type will have data interlaced in the lower and upper bytes of an Integer datatype.

count is the number of elements that you want placed into the buffer.

dataType is the code for the type of data you want in the buffer.  Allowed values are:

WFM_DATA_U8 (0):	unsigned 8-bit data

WFM_DATA_I16 (2):	signed 16-bit data

WFM_DATA_F64 (4):	double precision 64-bit data

WFM_DATA_U32 (7):	unsigned 32-bit data

These constants are defined in the NI-DAQ Examples Utility Function header files (see above).

mean is the pointer to the allocated memory space for the arithmetic mean (average).  This parameter is returned by address.  Please make sure memory is allocated for this value.

status is the return code of this function.  Possible return codes are:

NIDAQEX_INVALID_BUFFER (-12): buffer is invalid.

NIDAQEX_INVALID_NUMPTS (-14): count is invalid.

NIDAQEX_INVALID_TYPE (-53): datatype code is invalid.

These return codes are compatible with the return codes used in LabWindows/CVI.

Using This Function

Use this function to calculate the arithmetic mean of numbers in a data array.

This is useful when you are averaging single-point readings, or averaging buffered readings to eliminate 50/60 Hz noise.

NIDAQPlotWaveform

Format

status = NIDAQPlotWaveform(buffer, count, dataType)

Purpose

(LabWindows/CVI) To plot a buffer of data returned from NI-DAQ functions that perform a buffered input operation.

(Other languages) To preview up to the first 25 points of data in your buffer in a simple dialog box.

Parameters

Input

Name	Type	Description
buffer	VOID*	Buffer to be displayed
count	U32	Number of elements to be displayed
dataType	U32	Datatype

Return Type

Name	Type	Description
status	I16	Status Code

Parameter Discussion

buffer is the pointer to the allocated memory space for the buffer.

count is the number of elements that you displayed.

dataType is the code for the type of data in the buffer.  Allowed values are:

WFM_DATA_U8 (0):	unsigned 8-bit data

WFM_DATA_I16 (2):	signed 16-bit data

WFM_DATA_F64 (4):	double precision 64-bit data

WFM_DATA_U32 (7):	unsigned 32-bit data

These constants are defined in the NI-DAQ Examples Utility Function header files (see above).

status is the return code of this function.  Possible return codes are:

NIDAQEX_INVALID_BUFFER (-12): buffer is invalid.

NIDAQEX_INVALID_NUMPTS (-14): count is invalid.

NIDAQEX_INVALID_TYPE (-53): datatype code is invalid.

These return codes are compatible with the return codes used in LabWindows/CVI.

Using This Function

(LabWindows/CVI) Use this function to display a buffer of data in a pop-up graph with an OK button.  Since the graph will appear in an application modal dialog box, this function is not suitable for displaying data that changes continuously and rapidly. In LabWindows/CVI, the YGraphPopup() function is used.

When you are done viewing the data, click on the OK button.

NIDAQWaitForKey

Format

status = NIDAQWaitForKey(timeLimit)

Purpose

To wait for a key to be hit until a timeout value in seconds elapses.

Parameters

Input

Name	Type	Description
timeLimit	F64	time limit value (in seconds)

Return Type

Name	Type	Description
status	I16	Status Code

Parameter Discussion

timeLimit selects the timeout limit in seconds.  If the timeout limit is reached, this function will return a status of 0.  If timeLimit is set to 0.0, this function will wait forever until a key is hit.

status is the return code of this function.  This function will only return 0.

Using This Function

Use this function to wait for a user to hit a key.

In LabWindows/CVI, this function calls KeyHit().

In the NIDEX32.DLL, this function calls the ANSI C function kbhit() as well as the Windows API function PeekMessage() to see if any keys have been hit.  If a key hit was detected by PeekMessage(), the Windows API function GetMessage() is called to retrieve the keyboard messages (between WM_KEYDOWN and WM_KEYUP).

NIDAQYield

Format

status = NIDAQYield(yieldMode)

Purpose

To yield for other system events to happen.

Parameters

Input

Name	Type	Description
yieldMode	I16	select yield mode

Return Type

Name	Type	Description
status	I16	Status Code

Parameter Discussion

yieldMode selects if this function will yield to other system events or not.  Setting this parameter to 0 will not yield, and setting this parameter to any non-zero value will yield.

status is the return code of this function.  This function will only return 0.

Using This Function

Use this function to allow the system to process other events.  This function is particularly useful when you need to poll for a status as a foreground task in a loop.  Polling in a loop can force the CPU to dedicate more than necessary CPU time, which could potentially prevent other system events from happening.

In LabWindows/CVI, this function calls ProcessSystemEvents().

In Visual Basic, this function call is actually replaced by DoEvents.

In the NIDEX32.DLL, this function calls the Windows API function Sleep().with a parameter of 0 ms (this relinquishes the remainder of the process' timeslice to any other thread of equal priority that is ready to run).


Application Modal Dialog Box

An application modal dialog box is a dialog box that prevents the application from proceeding any further until the dialog box is closed.


Topic match not found...

There were no available topics that matched the selected keywords or search criteria.


AIonePoint
Example: AIonePoint

Description

Read one channel, one point at a time, immediately

Example Category

AI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iChan

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

AI_VRead

NIDAQErrorHandler

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


AIonePointExtConv
Example: AIonePointExtConv

Description

Read one analog input channel, one point at a time, using external timing

Example Category

AI

Example Task Types

1PT, 1CH, EXTTIM

List of key parameters

iChan, iReadingAvail

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

AI_Clear

NIDAQErrorHandler

AI_Setup

AI_Check

NIDAQYield

AI_VScale

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse (falling edge for most DAQ devices) to the 'external conversion' pin.

[For further I/O connection details, please refer to your hardware User Manual.]


AIonePointExtConv_Eseries
Example: AIonePointExtConv_Eseries

Description

Read one channel, one point at a time, using external timing (for E-series devices)

Example Category

AI

Example Task Types

1PT, 1CH, EXTTIM, ESER

List of key parameters

iChan, iReadingAvail

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

AI_Clear

NIDAQErrorHandler

Select_Signal

AI_Setup

AI_Check

NIDAQYield

AI_VScale

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse (falling edge) to the PFI2/CONVERT* pin.

[For further I/O connection details, please refer to your hardware User Manual.]


AIonePointAMUX
Example: AIonePointAMUX

Description

Read a set of channels from an AMUX-64T

Example Category

AI

Example Task Types

1PT, NCH, IMMED

List of key parameters

iNumMuxBrds, iChan

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

AI_Mux_Config

NIDAQErrorHandler

AI_VRead

Pin Connection Information

Connect your analog signal to AI channel 1 of the AMUX-64T. This program is configured for use with only one AMUX-64T. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQdoubleBuf
Example: DAQdoubleBuf

Description

Read a waveform from one analog input channel continuously using internal timing (uses low-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, 1CH, CONT, INTTIM, ASYNC, INTTRIG

List of key parameters

iDBmodeON, ulCount, iSampTB, iHalfReady, lTimeout

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

DAQ_Rate

DAQ_DB_Config

DAQ_Start

DAQ_DB_HalfReady

DAQ_DB_Transfer

NIDAQYield

DAQ_Clear

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufSync
Example: DAQsingleBufSync

Description

Read a waveform from one analog input channel using internal timing (uses high-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, SYNC, INTTRIG

List of key parameters

lTimeout, dSampRate

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

DAQ_Op

DAQ_VScale

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufAsync
Example: DAQsingleBufAsync

Description

Read a waveform from one analog input channel using internal timing (uses low-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, ASYNC, INTTRIG

List of key parameters

iDAQstopped

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_Rate

DAQ_Start

NIDAQErrorHandler

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufExtConv
Example: DAQsingleBufExtConv

Description

Read a waveform from one analog input channel using external sample timing (uses low-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, EXTTIM, ASYNC, INTTRIG

List of key parameters

iExtConv, iSampTB

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_Config

NIDAQErrorHandler

DAQ_Start

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse train (falling edge for most DAQ devices) to the 'external conversion' pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufExtConv_Eseries
Example: DAQsingleBufExtConv_Eseries

Description

Read a waveform from one analog input channel using external sample timing (uses low-level NI-DAQ functions, for E-series devices)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, EXTTIM, ASYNC, INTTRIG, ESER

List of key parameters

iExtConv, iSampTB

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Select_Signal

NIDAQErrorHandler

DAQ_Config

DAQ_Start

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse (falling edge) to the PFI2/CONVERT* pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufExtTrig
Example: DAQsingleBufExtTrig

Description

Read a waveform from one analog input channel upon an external digital trigger using internal timing (uses low-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, INTTIM, ASYNC, EXTTRIG

List of key parameters

iStartTrig, iSampTB

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_Config

NIDAQErrorHandler

DAQ_Rate

DAQ_Start

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse (falling edge for most DAQ devices) to the 'external start trigger' pin, and the ground reference to DIG GND.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufExtTrig_Eseries
Example: DAQsingleBufExtTrig_Eseries

Description

Read a waveform from one analog input channel upon an external digital trigger using internal timing (uses low-level NI-DAQ functions, for E-series devices)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, INTTIM, ASYNC, EXTTRIG, ESER

List of key parameters

iStartTrig, iSampTB

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Select_Signal

NIDAQErrorHandler

DAQ_Config

DAQ_Rate

DAQ_Start

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse (falling edge) to the PFI0/TRIG0 pin, and the ground reference to DIG GND.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufStopTrig
Example: DAQsingleBufStopTrig

Description

Read a waveform from one analog input channel until an external digital STOP trigger (10 samples taken after STOP trigger), using internal timing (uses low-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, INTTIM, ASYNC, STOPTRIG

List of key parameters

iStopTrigON, ulPtsAfterStopTrig, iSampTB

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_StopTrigger_Config

NIDAQErrorHandler

DAQ_Rate

DAQ_Start

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse (rising edge for most devices) to the 'external stop trigger' pin, and the ground reference to DIG GND.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufStopTrig_Eseries
Example: DAQsingleBufStopTrig_Eseries

Description

Read a waveform from one analog input channel until an external digital STOP trigger (10 samples taken after STOP trigger), using internal timing (uses low-level NI-DAQ functions, for E-series devices)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, INTTIM, ASYNC, STOPTRIG, ESER

List of key parameters

iStopTrigON, ulPtsAfterStopTrig, iSampTB

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_StopTrigger_Config

NIDAQErrorHandler

Select_Signal

DAQ_Rate

DAQ_Start

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse (falling edge) to the PFI1/TRIG2 pin, and the ground reference to 'digital ground'.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufToDisk
Example: DAQsingleBufToDisk

Description

Read a waveform from one analog input channel and store the binary data to a file (DAQdata.DAT) (uses high-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, INTTIM, SYNC, INTTRIG, DISK

List of key parameters

strFilename

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

DAQ_to_Disk

Pin Connection Information

Connect your analog signal to AI channel 1. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


DAQsingleBufAnalogTrig
Example: DAQsingleBufAnalogTrig

Description

Read a waveform from one analog input channel upon an rising-slope analog trigger using internal timing (uses low-level NI-DAQ functions, ONLY for E-series devices with analog triggering support)

Example Category

AI

Example Task Types

BUF, 1CH, BURST, INTTIM, ASYNC, ATRIG

List of key parameters

lLowValue, lHighValue, iSampTB

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Configure_HW_Analog_Trigger

NIDAQErrorHandler

Select_Signal

DAQ_Rate

DAQ_Start

DAQ_Check

NIDAQYield

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signal to AI channel 1. Connect the ground reference of the analog signal to AIGND. The signal you connect will be the analog trigger signal. The default analog input mode for the DAQ device will be used. NOTE... The analog trigger source can also be set to PFI0, if you set the last parameter in Config_HW_Analog_Trigger to ND_PFI_0.

[For further I/O connection details, please refer to your hardware User Manual.]


SCANsingleBufSync
Example: SCANsingleBufSync

Description

Read a waveform from two analog input channels using internal timing (uses high-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, NCH, BURST, SYNC, INTTRIG

List of key parameters

lTimeout, dSampRate, dScanRate

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

SCAN_Op

SCAN_Demux

DAQ_VScale

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signals to AI channels 1 and 2. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


SCANsingleBufAsync
Example: SCANsingleBufAsync

Description

Read a waveform from two analog input channels using internal timing (uses low-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, NCH, BURST, ASYNC, INTTRIG

List of key parameters

iScanTB, uScanInt

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_Rate

SCAN_Setup

NIDAQErrorHandler

SCAN_Start

DAQ_Check

NIDAQYield

SCAN_Demux

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signals to AI channels 1 and 2. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


SCANsingleBufExtScan
Example: SCANsingleBufExtScan

Description

Read a waveform from two analog input channels using external scan interval timing but with internal sample timing (uses low-level NI-DAQ functions)

Example Category

AI

Example Task Types

BUF, NCH, BURST, EXTTIM, ASYNC, INTTRIG

List of key parameters

iExtScan, iScanTB, uScanInt

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_Config

NIDAQErrorHandler

DAQ_Rate

SCAN_Setup

SCAN_Start

DAQ_Check

NIDAQYield

SCAN_Demux

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signals to AI channels 1 and 2. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse train to the 'external scan clock' pin. (NOTE: This is NOT the pin labelled "SCANCLK" but instead is a counter output pin.)

[For further I/O connection details, please refer to your hardware User Manual.]


SCANsingleBufExtScan_Eseries
Example: SCANsingleBufExtScan_Eseries

Description

Read a waveform from two analog input channels using external scan interval timing (uses low-level NI-DAQ functions, for E-series devices)

Example Category

AI

Example Task Types

BUF, NCH, BURST, EXTTIM, ASYNC, INTTRIG, ESER

List of key parameters

iExtScan, iScanTB, uScanInt

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Select_Signal

NIDAQErrorHandler

DAQ_Config

DAQ_Rate

SCAN_Setup

SCAN_Start

DAQ_Check

NIDAQYield

SCAN_Demux

DAQ_VScale

DAQ_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signals to AI channels 1 and 2. The default analog input mode for the DAQ device will be used. Also, connect a digital pulse train to the PFI7/STARTSCAN pin.

[For further I/O connection details, please refer to your hardware User Manual.]


SCANsingleBufMultiRate
Example: SCANsingleBufMultiRate

Description

Read a waveform from three analog input channels at per-channel scan rate divisors of 1:2:4:8 (uses low-level NI-DAQ functions) NOTE: There are quite a few hardware limitations depending on devices when using this example.  Refer to the description for the SCAN_Sequence_Setup function for details.

Example Category

AI

Example Task Types

BUF, NCH, BURST, INTTIM, ASYNC, INTTRIG

List of key parameters

lTimeout, dSampRate, dScanRate, piScanRateDivVect, pulSampsPerChanVect

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCAN_Sequence_Setup

NIDAQErrorHandler

SCAN_Sequence_Retrieve

DAQ_Rate

SCAN_Start

DAQ_Check

SCAN_Sequence_Demux

DAQ_VScale

NIDAQPlotWaveform

DAQ_Clear

Pin Connection Information

Connect your analog signals to AI channels 1,2,3 and 4. The default analog input mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


SCC_A10
Example: SCC_A10

Description

Use the SCC-A10 module with an E-series device to measure a voltage signal attenuated by a factor of 10. (Requires an SCC carrier, such as the SC-2345, and the SCC-A10 signal conditioning component)

Example Category

AI

Example Task Types

BUF, 1CH, SYNC, INTTIM, ESER

List of key parameters

lTimeout, iInputMode, iInputRange, iPolarity, dSampRate

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

AI_Configure

DAQ_Op

DAQ_VScale

NIDAQMean

NIDAQPlotWaveform

Pin Connection Information

Connect the signal to the SCC-A10 in the channel 0 slot.

[For further I/O connection details, please refer to your hardware User Manual.]


SCC_CI20
Example: SCC_CI20

Description

Use the SCC-CI20 module with an E-series device to measure a current signal through a current resistor (249ohms) (Requires an SCC carrier, such as the SC-2345, and the SCC-CI20 signal conditioning component)

Example Category

AI

Example Task Types

BUF, 1CH, SYNC, INTTIM, ESER

List of key parameters

lTimeout, iInputMode, iInputRange, iPolarity, dSampRate

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

AI_Configure

DAQ_Op

DAQ_VScale

NIDAQMean

NIDAQPlotWaveform

Pin Connection Information

Connect the signal to the SCC-CI20 in the channel 0 slot.

[For further I/O connection details, please refer to your hardware User Manual.]


AOonePoint
Example: AOonePoint

Description

Output one channel, one point at a time, immediately (first output 2.5 volts, then after a key press, 0 volts)

Example Category

AO

Example Task Types

1PT, 1CH, IMMED, INTTIM

List of key parameters

iChan

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQWaitForKey

AO_VWrite

NIDAQErrorHandler

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


AOonePointCurrent
Example: AOonePointCurrent

Description

Output one channel, one current value point at a time, immediately (first output 5mA then 0A)

Example Category

AO

Example Task Types

1PT, 1CH, IMMED, INTTIM

List of key parameters

iChan

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

AO_Change_Parameter

NIDAQErrorHandler

NIDAQWaitForKey

AO_VWrite

Pin Connection Information

The analog output current signal will be available at AO current channel 0.  Please note that on some devices, the current output and the voltage output may be on different I/O connector pins. Also, some devices may require an external power source to drive the current.

[For further I/O connection details, please refer to your hardware User Manual.]


AOonePointExtUpdate
Example: AOonePointExtUpdate

Description

Output one channel from one analog output channel, using external timing

Example Category

AO

Example Task Types

1PT, 1CH, EXTTIM

List of key parameters

iUpdateModeEXT

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

AO_VWrite

AO_Configure

NIDAQErrorHandler

NIDAQWaitForKey

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used. Also, connect a digital pulse to the 'external update' pin.

[For further I/O connection details, please refer to your hardware User Manual.]


AOonePointExtUpdate_Eseries
Example: AOonePointExtUpdate_Eseries

Description

Output one channel, one point at a time, using external timing (for E-series devices)

Example Category

AO

Example Task Types

1PT, 1CH, EXTTIM, ESER

List of key parameters

iUpdateModeEXT

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

AO_VWrite

AO_Configure

NIDAQErrorHandler

Select_Signal

NIDAQWaitForKey

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used. Also, connect a digital pulse to the PFI5/UPDATE* pin.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMdoubleBuf
Example: WFMdoubleBuf

Description

Continuously outputs a waveform from one analog output channel, using internal timing (uses low-level NI-DAQ functions)

Example Category

AO

Example Task Types

BUF, 1CH, CONT, ASYNC, INTTIM, INTTRIG

List of key parameters

iDBmodeON, iOldDataStop, iPartialTransferStop, ulIterations, iWFMstopped

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

NIDAQMakeBuffer

WFM_DB_Config

WFM_Group_Setup

WFM_Scale

WFM_Load

WFM_Rate

WFM_ClockRate

WFM_Group_Control

WFM_DB_HalfReady

WFM_DB_Transfer

NIDAQYield

WFM_Check

AO_VWrite

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMsingleBufSync
Example: WFMsingleBufSync

Description

Output a waveform from one analog output channel, using internal timing (uses high-level NI-DAQ functions)

Example Category

AO

Example Task Types

BUF, 1CH, BURST, SYNC, INTTIM, INTTRIG

List of key parameters

ulIterations

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

NIDAQMakeBuffer

WFM_Scale

WFM_Op

AO_VWrite

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMsingleBufAsync
Example: WFMsingleBufAsync

Description

Output a waveform from one analog output channel, using internal timing (uses low-level NI-DAQ functions)

Example Category

AO

Example Task Types

BUF, 1CH, BURST, ASYNC, INTTIM, INTTRIG

List of key parameters

iGroup, ulIterations, iWFMstopped, iOpSTART, iOpCLEAR

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

WFM_Group_Setup

NIDAQErrorHandler

WFM_Scale

WFM_Load

WFM_Rate

WFM_ClockRate

WFM_Group_Control

WFM_Check

NIDAQYield

AO_VWrite

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMsingleBufExtUpdate
Example: WFMsingleBufExtUpdate

Description

Output a waveform from one analog output channel, using external timing (uses low-level NI-DAQ functions)

Example Category

AO

Example Task Types

BUF, 1CH, BURST, ASYNC, EXTTIM, INTTRIG

List of key parameters

iGroup, ulIterations, iUpdateTB, iWFMstopped, iOpSTART, iOpCLEAR

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

WFM_Group_Setup

NIDAQErrorHandler

WFM_Scale

WFM_Load

WFM_ClockRate

WFM_Group_Control

WFM_Check

NIDAQYield

AO_VWrite

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used. Also, connect a digital pulse train to the 'external update' pin.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMsingleBufExtUpdate_Eseries
Example: WFMsingleBufExtUpdate_Eseries

Description

Output a waveform from one analog output channel, using external timing (uses low-level NI-DAQ functions, for E-series)

Example Category

AO

Example Task Types

BUF, 1CH, BURST, ASYNC, EXTTIM, INTTRIG, ESER

List of key parameters

iGroup, ulIterations, iUpdateTB, iWFMstopped, iOpSTART, iOpCLEAR

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

WFM_Group_Setup

NIDAQErrorHandler

WFM_Scale

WFM_Load

WFM_ClockRate

Select_Signal

WFM_Group_Control

WFM_Check

NIDAQYield

AO_VWrite

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used. Also, connect a digital pulse train to the PFI5/UPDATE* pin.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMsingleBufRegenerate
Example: WFMsingleBufRegenerate

Description

Repeatedly outputs a waveform from one analog output channel, using internal timing (uses high-level NI-DAQ functions)

Example Category

AO

Example Task Types

BUF, 1CH, BURST, SYNC, INTTIM, INTTRIG

List of key parameters

ulIterations, ulItersDone

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

WFM_Scale

NIDAQErrorHandler

WFM_Op

WFM_Check

WFM_Group_Control

AO_VWrite

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMsingleBufExtTrig_Eseries
Example: WFMsingleBufExtTrig_Eseries

Description

Outputs a waveform from one analog output channel, upon an external digital trigger, using internal timing (uses high-level NI-DAQ functions, for E-series)

Example Category

AO

Example Task Types

BUF, 1CH, BURST, SYNC, INTTIM, EXTTRIG, ESER

List of key parameters

ulIterations

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

NIDAQMakeBuffer

Select_Signal

WFM_Scale

WFM_Op

AO_VWrite

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used. Also, connect a digital pulse train to the PFI6/WFTRIG pin.

[For further I/O connection details, please refer to your hardware User Manual.]


WFMsingleBufFromDisk
Example: WFMsingleBufFromDisk

Description

Outputs a waveform from one analog output channel, using data on a disk file (DAQdata.DAT). You can use the datafile from the 'DAQsingleBuftoDisk' example program. (uses high-level NI-DAQ functions)

Example Category

AO

Example Task Types

BUF, 1CH, BURST, SYNC, INTTIM, INTTRIG, DISK

List of key parameters

ulStartPt, ulEndPt, ulIterations

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

WFM_from_Disk

Pin Connection Information

The analog output signal will be available at AO channel 0. The default analog output mode for the DAQ device will be used.

[For further I/O connection details, please refer to your hardware User Manual.]


Calibrate_Eseries
Example: Calibrate_Eseries

Description

Calibrate an E-series board using internal voltage reference (SELF_CALIBRATE) and store calibration constants in USER_EEPROM_AREA. (E-series only)  This example also takes measurements over 50/60Hz sinewave periods and averages the data before and after calibration, so you can compare.

Example Category

CALIB

Example Task Types

ESER, BUF, 1CH, SYNC, INTTIM

List of key parameters

piBuffer, dSampRate, ulCalOp, ulSetOfCalConst

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DAQ_Op

NIDAQErrorHandler

NIDAQMean

Calibrate_E_Series

Pin Connection Information

Ground the inputs to AI channel 1.  If the device is in differential mode, tie both the + and - inputs to AIGND. If the device is in single-ended mode, tie the input to AIGND.

[For further I/O connection details, please refer to your hardware User Manual.]


8253eventCount
Example: 8253eventCount

Description

Counts the number of digital pulses (or events, Mode 0) going into the clock input of counter 1, ten times (for devices with the 8253 interval counter/timer)

Example Category

CTR

Example Task Types

EVENTCNT

List of key parameters

iCtr, iMode

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

ICTR_Setup

NIDAQErrorHandler

ICTR_Read

NIDAQDelay

NIDAQYield

ICTR_Reset

Pin Connection Information

Connect your digital pulse train to the CLK1 or CLKB1pin. Connect the ground reference to the DIG GND pin. You can gate the count if you connect a digital signal to GATE1 or GATB1.  A logic 'low' would halt counting, and a logic 'high' would continue counting.

[For further I/O connection details, please refer to your hardware User Manual.]


8253generateSinglePulse
Example: 8253generateSinglePulse

Description

Generates a single digital pulse from counter 0 (Mode 0, for devices with the 8253 interval counter/timer)

Example Category

CTR

Example Task Types

PLSTRN

List of key parameters

iCtr, iMode

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

ICTR_Setup

NIDAQErrorHandler

NIDAQDelay

ICTR_Reset

Pin Connection Information

Your digital pulse (active LOW) will be on the OUT0 or OUTB0 pin. Connect the ground reference to the DIG GND pin. You can "gate" the pulse train off if you connect a digital logic LOW signal to the GATE0 or GATB0 pin. NOTE: not all devices with the 8253 have a counter 0.

[For further I/O connection details, please refer to your hardware User Manual.]


8253generateSquareWave
Example: 8253generateSquareWave

Description

Generates a square wave (digital pulse train) from counter 0 (for devices with the 8253 interval counter/timer)

Example Category

CTR

Example Task Types

PLSTRN

List of key parameters

iCtr, iMode

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

ICTR_Setup

NIDAQWaitForKey

ICTR_Reset

Pin Connection Information

Your digital pulse train will be on the OUT0 or OUTB0 pin. Connect the ground reference to the DIG GND pin. You can "gate" the pulse train off if you connect a digital logic LOW signal to the GATE0 or GATB0 pin. NOTE: not all devices with the 8253 have a counter 0.

[For further I/O connection details, please refer to your hardware User Manual.]


9513eventCount
Example: 9513eventCount

Description

Counts the number of digital pulses (or events) going into the clock input of counter 1 in a loop (for devices with the Am9513 counter/timer)

Example Category

CTR

Example Task Types

EVENTCNT

List of key parameters

iCtr, iEdgeMode, iTimeBase

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

CTR_Config

NIDAQErrorHandler

CTR_EvCount

CTR_EvRead

NIDAQDelay

NIDAQYield

CTR_Reset

Pin Connection Information

Connect your digital pulse train to the SOURCE1 pin. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


9513freqMeasure
Example: 9513freqMeasure

Description

Measures the frequency of a digital pulse train using counter 5 and a 1 second pulse generated from counter 1 (for devices with the Am9513 counter/timer). See NOTE below about measuring frequencies above 65535Hz.

Example Category

CTR

Example Task Types

FREQM, INTTIM

List of key parameters

iCtr2, iGateMode2, iTimeBase1, iTimeBase2, uPulseWidth

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

CTR_Config

NIDAQErrorHandler

CTR_Period

CTR_Pulse

NIDAQDelay

CTR_State

NIDAQYield

CTR_EvRead

CTR_Reset

Pin Connection Information

Connect your digital pulse train to the SOURCE5 pin. Also, connect OUT1 to GATE5. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


9513generateSinglePulse
Example: 9513generateSinglePulse

Description

Generates a single digital pulse 1 ms LOW and 100 ms HIGH using counter 1 and an internal timebase (for devices with the Am9513 counter/timer)

Example Category

CTR

Example Task Types

PULSTRN, INTTIM

List of key parameters

iOutType, iTimeBase, uDelay, uPulseWidth

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

CTR_Config

NIDAQErrorHandler

CTR_Pulse

NIDAQDelay

CTR_State

NIDAQYield

CTR_Reset

Pin Connection Information

Your digital pulse will be on the OUT1 pin. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


9513generateSquareWave
Example: 9513generateSquareWave

Description

Generates a square wave (digital pulse train) with 1kHz frequency and 50% duty cycle using counter 1 and an internal timebase (for devices with the Am9513 counter/timer)

Example Category

CTR

Example Task Types

PULSTRN, INTTIM

List of key parameters

iOutType, dFreq, dDutyCycle, iTimeBase, uPeriod1, uPeriod2

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

CTR_Config

NIDAQErrorHandler

CTR_Rate

CTR_Square

NIDAQWaitForKey

CTR_Reset

Pin Connection Information

Your digital pulse train will be on the OUT1 pin. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


9513generateFreqOut
Example: 9513generateFreqOut

Description

Generates a square wave (digital pulse train) with 1kHz frequency (fixed 50% duty cycle) using the 4-bit frequency divider, FOUT, and an internal timebase (for devices with the Am9513 counter/timer)

Example Category

CTR

Example Task Types

PULSTRN, INTTIM

List of key parameters

iModeON, iTimeBase, iDivision

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

CTR_FOUT_Config

NIDAQErrorHandler

NIDAQWaitForKey

Pin Connection Information

Your digital pulse train will be on the FOUT (or FOUT1, if using TIO-10) pin. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


9513pulseWidthMeasure
Example: 9513pulseWidthMeasure

Description

Measures the width of a single digital pulse using counter 1 and a 1MHz internal timebase (for devices with the Am9513 counter/timer)

Example Category

CTR

Example Task Types

PLSWM, INTTIM

List of key parameters

iCtr, iGateMode, iTimeBase

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

CTR_Config

NIDAQErrorHandler

CTR_Period

NIDAQDelay

CTR_EvRead

CTR_Reset

Pin Connection Information

Connect your digital pulse to the GATE1 pin. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCcountWithHWDirControl
Example: STCcountWithHWDirControl

Description

Counts the number of digital pulses (or events) going into the clock input of general purpose counter 0 in a loop, with digital count direction control, so that the counter will count UP when the direction signal is HIGH, and DOWN when the direction signal is LOW. (for devices with the DAQ-STC counter/timer)

Example Category

CTR

Example Task Types

EVENTCNT, 1PT

List of key parameters

ulGpctrNum, ulCount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

NIDAQDelay

GPCTR_Watch

NIDAQYield

Pin Connection Information

Connect your digital pulse train to the SOURCE pin of your counter.  Connect your digital direction control signal to DIO6 (for GPCTR0 on DAQ-STC) or PFI37 (for Counter 0 on NI-TIO based devices). Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCeventCount
Example: STCeventCount

Description

Counts the number of digital pulses (or events) going into the clock input of general purpose counter 0 in a loop (for devices with the DAQ-STC counter/timer)

Example Category

CTR

Example Task Types

EVENTCNT, 1PT

List of key parameters

ulGpctrNum, ulCount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Watch

NIDAQDelay

NIDAQYield

Pin Connection Information

Connect your digital pulse train to the SOURCE pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCgenerateSinglePulse
Example: STCgenerateSinglePulse

Description

Generates a single digital pulse 100 ms wide (output HIGH) delayed 1 ms after the trigger using general purpose counter 0 and an internal 100kHz timebase (for devices with the DAQ-STC counter/timer)

Example Category

CTR

Example Task Types

PLSTRN, 1PT

List of key parameters

ulGpctrNum, ulGpctrOutput, ulLOWcount, ulHIGHcount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

Select_Signal

GPCTR_Watch

NIDAQYield

Pin Connection Information

Your digital pulse will be on the OUT pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCgenerateSingleTriggeredPulse
Example: STCgenerateSingleTriggeredPulse

Description

Generates a single digital pulse 1 ms LOW and 100 ms HIGH using general purpose counter 0 upon a trigger (for devices with the DAQ-STC counter/timer)

Example Category

CTR

Example Task Types

PLSTRN, 1PT

List of key parameters

ulGpctrNum, ulGpctrOutput, ulLOWcount, ulHIGHcount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

Select_Signal

GPCTR_Watch

NIDAQYield

Pin Connection Information

Your digital pulse will be on the OUT pin of your counter. Connect your digital trigger pulse to the GATE pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCgenerateRepeatedTriggeredPulse
Example: STCgenerateRepeatedTriggeredPulse

Description

Repeatedly generates a digtal pulse 1 ms LOW and 100 ms HIGH using general purpose counter 0 upon every trigger.  This is different from CSTC1tPl in that you don't have to rearm after each trigger. (for devices with the DAQ-STC counter/timer)

Example Category

CTR

Example Task Types

PLSTRN, 1PT

List of key parameters

ulGpctrNum, ulGpctrOutput, ulLOWcount, ulHIGHcount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

Select_Signal

NIDAQWaitForKey

Pin Connection Information

Your digital pulses will be on the OUT pin of your counter. Connect your digital trigger pulse to the GATE pin of your counter Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCgenerateSquareWave
Example: STCgenerateSquareWave

Description

Generates a 1kHz square wave (digital pulse train) using general purpose counter 0 and an internal 100kHz timebase. (for devices with the DAQ-STC counter/timer)

Example Category

CTR

Example Task Types

PLSTRN

List of key parameters

ulGpctrNum, ulGpctrOutput, ulLOWcount, ulHIGHcount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

Select_Signal

NIDAQWaitForKey

Pin Connection Information

Your digital pulse train will be on the OUT pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCsinglePeriodMeasure
Example: STCsinglePeriodMeasure

Description

Takes one measurement of the period of a digital pulse train using general purpose counter 0 (for devices with the DAQ-STC counter/timer)

Example Category

CTR

Example Task Types

PERM, INTTIM, 1PT

List of key parameters

ulGpctrNum, ulCount, ulArmed

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Watch

NIDAQYield

Pin Connection Information

Connect your digital pulse train signal to the GATE pin of your counter. Connect the ground reference to the DIGGND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCsinglePulseWidthMeasure
Example: STCsinglePulseWidthMeasure

Description

Measures the pulse width of a single digital pulse using general purpose counter 0 (for devices with the DAQ-STC counter/timer.)

Example Category

CTR

Example Task Types

PLSWM, 1PT

List of key parameters

ulGpctrNum, ulCount, ulArmed

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Watch

NIDAQYield

Pin Connection Information

Connect your single digital pulse signal to the GATE pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCsingleTriggeredPulseWidthMeasure
Example: STCsingleTriggeredPulseWidthMeasure

Description

Measures the pulse width of a single digital pulse using general purpose counter 0 upon a trigger (for devices with the DAQ-STC counter/timer.)

Example Category

CTR

Example Task Types

PLSWM, 1PT

List of key parameters

ulGpctrNum, ulCount, ulArmed

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Watch

NIDAQYield

Pin Connection Information

Connect your digital pulse signal to the GATE pin of your counter. Connect the ground reference to the DIGGND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCsingleBufEventCount
Example: STCsingleBufEventCount

Description

Counts the number of digital pulses that occur between consecutive digital triggers on the gate input, using general purpose counter 0 and an internal 20MHz timebase. (for devices with the DAQ-STC counter/timer) Regarding using your own timebase source for buffered GPCTR operations, refer to the GPCTR_Set_Application description in the NI-DAQ Function Reference Manual.

Example Category

CTR

Example Task Types

EVENTCNT, BUF

List of key parameters

ulGpctrNum, pulBuffer, ulCount, ulArmed

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Config_Buffer

GPCTR_Watch

NIDAQYield

NIDAQPlotWaveform

Pin Connection Information

Connect your gating digital pulse train to the GATE pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCsingleBufPeriodMeasure
Example: STCsingleBufPeriodMeasure

Description

Counts the periods (time in between two consecutive pulses) of a digital pulse train, using general purpose counter 0 and an internal 20MHz timebase. (for devices with the DAQ-STC counter/timer) Regarding using your own timebase source for buffered GPCTR operations, refer to the GPCTR_Set_Application description in the NI-DAQ Function Reference Manual.

Example Category

CTR

Example Task Types

PERM, BUF

List of key parameters

ulGpctrNum, pulBuffer, ulCount, ulArmed

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Config_Buffer

GPCTR_Watch

NIDAQYield

NIDAQPlotWaveform

Pin Connection Information

Connect your digital pulse train to the GATE pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCsingleBufSemiperiodMeasure
Example: STCsingleBufSemiperiodMeasure

Description

Counts the semi-periods (HIGH duration and LOW duration, separately) of each pulse in a digital pulse train, using general purpose counter 0 and an internal 20MHz timebase. (for devices with the DAQ-STC counter/timer) Regarding using your own timebase source for buffered GPCTR operations, refer to the GPCTR_Set_Application description in the NI-DAQ Function Reference Manual.

Example Category

CTR

Example Task Types

PERM, BUF

List of key parameters

ulGpctrNum, pulBuffer, ulCount, ulArmed

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Config_Buffer

GPCTR_Watch

NIDAQYield

NIDAQPlotWaveform

Pin Connection Information

Connect your digital pulse train to the GATE pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


STCsingleBufPulseWidthMeasure
Example: STCsingleBufPulseWidthMeasure

Description

Counts the pulse widths (HIGH duration only) of each pulse in a digital pulse train, using general purpose counter 0 and an internal 20 MHz timebase. (for devices with the DAQ-STC counter/timer) Regarding using your own timebase source for buffered GPCTR operations, refer to the GPCTR_Set_Application description in the NI-DAQ Function Reference Manual.

Example Category

CTR

Example Task Types

PERM, BUF

List of key parameters

ulGpctrNum, pulBuffer, ulCount, ulArmed

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Config_Buffer

GPCTR_Watch

NIDAQYield

NIDAQPlotWaveform

Pin Connection Information

Connect your digital pulse train to the GATE pin of your counter. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


TIOcircularBufEventCount
Example: TIOcircularBufEventCount

Description

Counts the number of digital pulses (or events) in between gate pulses continuously into a circular-buffer (or double-buffer) using general purpose counter 0 (for NI-TIO based devices)

Example Category

CTR

Example Task Types

EVENTCNT, CONT, INTTIM, BUF

List of key parameters

ulGpctrNum, pulBuffer, pulReadBuf, ulCount, ulReadCount, ulArmed, iGateFasterThanSource

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Config_Buffer

GPCTR_Read_Buffer

NIDAQYield

Pin Connection Information

Connect a gating pulse train to the GATE pin of your counter (PFI 38 for 660x devices). Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


TIOeventCountWithFilter
Example: TIOeventCountWithFilter

Description

Counts the number of digital pulses (or events) using a general purpose counter 0 in a loop while using an internal filter set at 5uSec (for NI-TIO based devices)

Example Category

CTR

Example Task Types

EVENTCNT, 1PT

List of key parameters

ulGpctrNum, ulLineNum, ulCount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

Line_Change_Attribute

GPCTR_Change_Parameter

GPCTR_Watch

NIDAQYield

Pin Connection Information

Connect your digital pulse train to the default source pin (PFI 39). Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


TIOeventCountWithPrescaling
Example: TIOeventCountWithPrescaling

Description

Counts the number of digital pulses (or events) using a general purpose counter 0 in a loop while using prescaling.  This is useful for counting signals with frequencies faster than the maximum internal timebase. (for NI-TIO based devices)

Example Category

CTR

Example Task Types

EVENTCNT, 1PT

List of key parameters

ulGpctrNum, ulLineNum, ulCount, ulPrescale

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Watch

GPCTR_Change_Parameter

NIDAQYield

Pin Connection Information

Connect your digital pulse train to the default source pin (PFI 39). Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


TIOgenSquareWave
Example: TIOgenSquareWave

Description

Generates a variable frequency squarewave (digital pulse train) between 1kHz and 100Hz using general purpose counter 0 and an internal 100kHz timebase. (for NI-TIO based devices)

Example Category

CTR

Example Task Types

PLSTRN, INTTIM

List of key parameters

ulGpctrNum, ulGpctrOutput, ulLOWcount, ulHIGHcount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

Select_Signal

NIDAQDelay

Pin Connection Information

Connect the ground reference to the DIG GND pin. Your digital pulse train will be on the counter's default output pin (PFI 36).

[For further I/O connection details, please refer to your hardware User Manual.]


TIOgenSquareWaveStartTrig
Example: TIOgenSquareWaveStartTrig

Description

Generates a 1kHz squarewave (digital pulse train) using general purpose counter 0 and an internal 100kHz timebase upon a digital start trigger (for NI-TIO based devices)

Example Category

CTR

Example Task Types

PLSTRN, INTTIM, EXTTRIG

List of key parameters

ulLineNum, ulGpctrNum, ulGpctrOutput, ulLOWcount, ulHIGHcount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

Select_Signal

NIDAQDelay

Pin Connection Information

Connect your start trigger on PFI 37. Connect the ground reference to the DIG GND pin. Your digital pulse train will be on the counter's default output pin (PFI 36).

[For further I/O connection details, please refer to your hardware User Manual.]


TIOquadEncoderPosMeasure
Example: TIOquadEncoderPosMeasure

Description

Counts the number of quadrature encoded digital pulses using a general purpose counter 0 in a loop. Also accepts a Z-index pulse so that the counter initializes automatically (for NI-TIO based devices)

Example Category

CTR

Example Task Types

EVENTCNT, 1PT

List of key parameters

ulGpctrNum, ulZIndexCount, ulInitCount

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

Line_Change_Attribute

GPCTR_Watch

NIDAQYield

Pin Connection Information

Connect your encoder channel A signal to the default source pin (PFI 39), the channel B signal to the default auxiliary line (PFI 37), and the Z-index pulse signal to the default gate pin (PFI 38).  Also, connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


TIOsingleBufEventCount
Example: TIOsingleBufEventCount

Description

Counts the number of digital pulses (or events) in between gate pulses into a single buffer using general purpose counter 0 (for NI-TIO based devices)

Example Category

CTR

Example Task Types

EVENTCNT, BURST, INTTIM, BUF

List of key parameters

ulGpctrNum, pulBuffer, ulCount, ulArmed, iGateFasterThanSource

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Config_Buffer

GPCTR_Watch

NIDAQYield

GPCTR_Read_Buffer

Pin Connection Information

Connect your digital pulse train to the GATE pin of your counter. (PFI 38 for 660x devices) Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


TIOtwoEdgeSeparationMeasure
Example: TIOtwoEdgeSeparationMeasure

Description

Counts the number of digital pulses (or events) between two independent gate pulses (gate and auxiliary line) using an internal 100kHz timebase (for NI-TIO based devices)

Example Category

CTR

Example Task Types

EVENTCNT, 1PT

List of key parameters

ulGpctrNum, ulCount, ulArmed, ulTCReached

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

GPCTR_Control

NIDAQErrorHandler

GPCTR_Set_Application

GPCTR_Change_Parameter

GPCTR_Watch

NIDAQYield

Pin Connection Information

Connect your digital START pulse to the default AUXILIARY line (PFI 37 for 660x devices) and your digital STOP pulse to default GATE pin (PFI 38 for 660x devices). Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIdoubleBufPatternGen653x
Example: DIdoubleBufPatternGen653x

Description

Inputs digital data continuously into a buffer from a group of two digital ports using internal timing (pattern generation, for DIO-32 series devices)

Example Category

DI

Example Task Types

BUF, NCH, INTTIM, CONT, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iDBModeON, iOldDataStop, ulCount, iHalfReady, ulBufferSize, ulAlignIndex, iResource, iIgnoreWarning

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

DIG_Grp_Config

DIG_Block_PG_Config

DIG_DB_Config

Align_DMA_Buffer

DIG_Block_In

DIG_DB_HalfReady

DIG_DB_Transfer

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIdoubleBufPatternGenExtClock653x
Example: DIdoubleBufPatternGenExtClock653x

Description

Inputs digital data continuously into a buffer from a group of two digital ports using external timing (pattern generation, for DIO-32 series devices)

Example Category

DI

Example Task Types

BUF, NCH, INTTIM, CONT, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iReqSource, iDBModeON, iOldDataStop, ulCount, iHalfReady, ulBufferSize, ulAlignIndex, iResource, iIgnoreWarning

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

DIG_Grp_Config

DIG_Block_PG_Config

DIG_DB_Config

Align_DMA_Buffer

DIG_Block_In

DIG_DB_HalfReady

DIG_DB_Transfer

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIdoubleBufChangeDetection653x
Example: DIdoubleBufChangeDetection653x

Description

Inputs digital data continuously into a buffer from a group of two digital ports. Data is latched in when any of the input lines change state 	(change detection, for DIO-32 series devices)

Example Category

DI

Example Task Types

BUF, NCH, INTTIM, CONT, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iReqSource, ulPatternMask, iDBModeON, iOldDataStop, ulCount, iHalfReady, ulBufferSize, ulAlignIndex, iResource, iIgnoreWarning

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

DIG_Grp_Config

DIG_Block_PG_Config

DIG_Trigger_Config

DIG_DB_Config

Align_DMA_Buffer

DIG_Block_In

DIG_DB_HalfReady

DIG_DB_Transfer

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIdoubleBufHandshake653x
Example: DIdoubleBufHandshake653x

Description

Inputs digital data continuously into a buffer from a group of two digital ports using handshaking (for DIO-32 series devices)

Example Category

DI

Example Task Types

BUF, NCH, INTTIM, CONT, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iAckPol, iDBModeON, iOldDataStop, ulCount, iHalfReady, ulBufferSize, ulAlignIndex, iResource, iIgnoreWarning

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

DIG_Grp_Config

DIG_Grp_Mode

DIG_DB_Config

Align_DMA_Buffer

DIG_Block_In

DIG_DB_HalfReady

DIG_DB_Transfer

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIoneGroupHandshake653x
Example: DIoneGroupHandshake653x

Description

Inputs digital data from a group of two digital ports upon a handshaking signal. (for DIO-32 series devices)

Example Category

DI

Example Task Types

1PT, NCH, HANDSHK

List of key parameters

iGroup, iGroupSize, iDir, iLatched

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Grp_Status

NIDAQYield

DIG_In_Grp

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DIoneLine
Example: DIoneLine

Description

Inputs digital data from a single digital line. Please note that some DAQ devices have predetermined port directions for each digital port.

Example Category

DI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iPort, iLine, iDir

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Line_Config

NIDAQErrorHandler

DIG_In_Line

Pin Connection Information

Connect your digital signal to port 0, line 0. Please note that some DAQ devices have predetermined port directions for each digital port. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIonePort
Example: DIonePort

Description

Inputs digital data from a single digital port. Please note that some DAQ devices have predetermined port directions for each digital port.

Example Category

DI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iMode, iDir

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Prt_Config

NIDAQErrorHandler

DIG_In_Prt

Pin Connection Information

Connect your digital signals to port 0. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIonePortHandshake
Example: DIonePortHandshake

Description

Inputs digital data from a single digital port upon a handshaking signal. Please note that some DAQ devices have predetermined port directions for each digital port.

Example Category

DI

Example Task Types

1PT, 1CH, HANDSHK

List of key parameters

iMode, iDir, iLatched

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Prt_Config

NIDAQErrorHandler

DIG_Prt_Status

NIDAQYield

DIG_In_Prt

Pin Connection Information

Connect your digital signals to port 0. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufPatternGen653x
Example: DIsingleBufPatternGen653x

Description

Inputs digital data into a buffer from a group of two digital ports using internal timing (or pattern generation, for DIO-32 series devices)

Example Category

DI

Example Task Types

BUF, NCH, INTTIM, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iPgConfig, iReqSource, iPgTB, iReqInt, ulCount, ulAlignIndex, iResource, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

Align_DMA_Buffer

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufHandshake653x
Example: DIsingleBufHandshake653x

Description

Inputs digital data into a buffer from a group of two digital ports using hanshaking (for DIO-32 series devices)

Example Category

DI

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iSignal, iEdge, iReqPol, iAckPol, iAckDelayTime, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Grp_Mode

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufHandshake8255
Example: DIsingleBufHandshake8255

Description

Inputs digital data into a buffer from a group of two digital ports using hanshaking (for 8255-based devices)

Example Category

DI

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_SCAN_Setup

NIDAQErrorHandler

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufPatternTrig653x
Example: DIsingleBufPatternTrig653x

Description

Inputs digital data into a buffer from a group of two digital ports upon a pattern-based trigger, using internal timing (for DIO-32HS devices)

Example Category

DI

Example Task Types

BUF, NCH, HANDSHK, PATTRIG, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iStartTrigON, iStartPol, ulPattern, ulPatternMask, ulCount, ulAlignIndex, ulBufferSize, iResource, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

DIG_Trigger_Config

Align_DMA_Buffer

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. The pattern to match is Hex '0001'. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufExtTrig653x
Example: DIsingleBufExtTrig653x

Description

Inputs digital data into a buffer from a group of two digital ports upon a digital start trigger, using internal timing (for DIO-32HS devices)

Example Category

DI

Example Task Types

BUF, NCH, HANDSHK, EXTTRIG, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iStartTrigON, ulCount, iResource, ulAlignIndex, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

DIG_Trigger_Config

Align_DMA_Buffer

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the digital trigger signal to the 'start trigger' pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufBurstHandshake653x
Example: DIsingleBufBurstHandshake653x

Description

Inputs digital data into a buffer from a group of two digital ports using burst mode hanshaking (for DIO-32HS 	 series devices)

Example Category

DI

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iSignal, iEdge, iReqPol, iAckPol, iAckDelayTime, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Grp_Mode

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufBurstHandshakeExtPClock653x
Example: DIsingleBufBurstHandshakeExtPClock653x

Description

Inputs digital data into a buffer from a group of two digital ports using burst mode hanshaking (for DIO-32HS series devices) 	 	   and an external PClock

Example Category

DI

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iSignal, iEdge, iReqPol, iAckPol, iAckDelayTime, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Grp_Mode

Set_DAQ_Device_Info

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufPatternGenExtClock653x
Example: DIsingleBufPatternGenExtClock653x

Description

Inputs digital data into a buffer from a group of two digital ports using external timing (or pattern generation, for DIO-32 series devices)

Example Category

DI

Example Task Types

BUF, NCH, EXTTIM, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iPgConfig, iReqSource, iPgTB, iReqInt, ulCount, ulAlignIndex, iResource, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

Align_DMA_Buffer

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DIsingleBufChangeDetection653x
Example: DIsingleBufChangeDetection653x

Description

Inputs digital data into a buffer from a group of two digital ports. Data is latched in only when the input changes.

Example Category

DI

Example Task Types

BUF, NCH, EXTTIM, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iPgConfig, iReqSource, iPgTB, iReqInt, ulPatternMask, ulCount, ulAlignIndex, iResource, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

DIG_Trigger_Config

Align_DMA_Buffer

DIG_Block_In

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

Connect your digital signals to ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DOdoubleBufPatternGen653x
Example: DOdoubleBufPatternGen653x

Description

Outputs digital data continuously into a buffer from a group of two digital ports using internal timing (pattern generation, for DIO-32 series devices)

Example Category

DO

Example Task Types

BUF, NCH, INTTIM, CONT, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iDBModeON, iOldDataStop, ulCount, iHalfReady, ulBufferSize, iResource, iIgnoreWarning, ulAlignIndex

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

NIDAQMakeBuffer

DIG_Grp_Config

DIG_Block_PG_Config

DIG_DB_Config

Align_DMA_Buffer

DIG_Block_Out

DIG_DB_HalfReady

DIG_DB_Transfer

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DOdoubleBufHandshake653x
Example: DOdoubleBufHandshake653x

Description

Outputs digital data continuously into a buffer from a group of two digital ports using handshaking (pattern generation, for DIO-32 series devices)

Example Category

DO

Example Task Types

BUF, NCH, INTTIM, CONT, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iAckPol, iDBModeON, iOldDataStop, ulCount, iHalfReady, ulBufferSize, iResource, iIgnoreWarning, ulAlignIndex

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

Timeout_Config

NIDAQErrorHandler

NIDAQMakeBuffer

DIG_Grp_Config

DIG_Grp_Mode

DIG_DB_Config

Align_DMA_Buffer

DIG_Block_Out

DIG_DB_HalfReady

DIG_DB_Transfer

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DOoneGroupHandshake
Example: DOoneGroupHandshake

Description

Outputs digital data from a group of two digital ports upon a handshaking signal

Example Category

DO

Example Task Types

1PT, NCH, HANDSHK

List of key parameters

iGroup, iGroupSize, iDir, iLatched

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Grp_Config

NIDAQErrorHandler

DIG_Out_Grp

DIG_Grp_Status

NIDAQYield

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DOoneLine
Example: DOoneLine

Description

Outputs digital data from a single digital line

Example Category

DO

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iPort, iLine, iDir

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Line_Config

NIDAQErrorHandler

DIG_Out_Line

NIDAQWaitForKey

Pin Connection Information

The digital signal will be on port 0, line 0. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DOonePort
Example: DOonePort

Description

Outputs digital data from a single digital port

Example Category

DO

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iMode, iDir

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Prt_Config

NIDAQErrorHandler

DIG_Out_Prt

NIDAQDelay

NIDAQYield

Pin Connection Information

The digital signals will be on port 0. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DOonePortHandshake
Example: DOonePortHandshake

Description

Outputs digital data from a single digital port upon a handshaking signal

Example Category

DO

Example Task Types

1PT, 1CH, HANDSHK

List of key parameters

iMode, iDir, iLatched

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

DIG_Prt_Config

NIDAQErrorHandler

DIG_Out_Prt

DIG_Prt_Status

NIDAQYield

Pin Connection Information

The digital signals will be on port 0. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DOsingleBufPatternGen653x
Example: DOsingleBufPatternGen653x

Description

Outputs digital data in a buffer from a group of two digital ports using internal timing (or pattern generation)

Example Category

DO

Example Task Types

BUF, NCH, INTTIM, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iPgConfig, iReqSource, iPgTB, iReqInt, ulCount, ulBufferSize, iResource, ulRemaining, ulAlignIndex

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

Align_DMA_Buffer

DIG_Block_Out

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DOsingleBufHandshake653x
Example: DOsingleBufHandshake653x

Description

Outputs digital data into a buffer from a group of two digital ports using hanshaking (for DIO-32 series devices)

Example Category

DO

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iSignal, iEdge, iReqPol, iAckPol, iAckDelayTime, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

DIG_Grp_Config

NIDAQErrorHandler

DIG_Grp_Mode

DIG_Block_Out

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DOsingleBufHandshake8255
Example: DOsingleBufHandshake8255

Description

Outputs digital data into a buffer from a group of two digital ports using hanshaking (for 8255-based devices)

Example Category

DO

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

DIG_SCAN_Setup

NIDAQErrorHandler

DIG_Block_Out

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DOsingleBufExtTrig653x
Example: DOsingleBufExtTrig653x

Description

Outputs digital data from a buffer to a group of two digital ports upon a digital start trigger, using internal timing (for DIO-32HS devices)

Example Category

DO

Example Task Types

BUF, NCH, HANDSHK, EXTTRIG, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iStartTrigON, ulCount, ulBufferSize, iResource, ulRemaining, ulAlignIndex

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

DIG_Trigger_Config

Align_DMA_Buffer

DIG_Block_Out

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

NIDAQPlotWaveform

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the digital trigger signal to the 'start trigger' pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DOsingleBufPatternGenExtClock653x
Example: DOsingleBufPatternGenExtClock653x

Description

Outputs digital data in a buffer from a group of two digital ports using external timing (or pattern generation)

Example Category

DO

Example Task Types

BUF, NCH, INTTIM, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iPgConfig, iReqSource, iPgTB, iReqInt, ulCount, ulBufferSize, iResource, ulRemaining, ulAlignIndex

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

DIG_Grp_Config

NIDAQErrorHandler

DIG_Block_PG_Config

Align_DMA_Buffer

DIG_Block_Out

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin.

[For further I/O connection details, please refer to your hardware User Manual.]


DOsingleBufBurstHandshake653x
Example: DOsingleBufBurstHandshake653x

Description

Outputs digital data into a buffer from a group of two digital ports using burst mode hanshaking (for DIO-32 series devices)

Example Category

DO

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iSignal, iEdge, iReqPol, iAckPol, iAckDelayTime, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

DIG_Grp_Config

NIDAQErrorHandler

DIG_Grp_Mode

Set_DAQ_Device_Info

DIG_Block_Out

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


DOsingleBufBurstHandshakeExtPClock653x
Example: DOsingleBufBurstHandshakeExtPClock653x

Description

Outputs digital data into a buffer from a group of two digital ports using burst mode hanshaking protocol and external PCLK(for DIO-32HS series devices)

Example Category

DO

Example Task Types

BUF, NCH, HANDSHK, BURST, ASYNC

List of key parameters

iGroup, iGroupSize, iDir, iSignal, iEdge, iReqPol, iAckPol, iAckDelayTime, ulCount, ulRemaining

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

NIDAQMakeBuffer

DIG_Grp_Config

NIDAQErrorHandler

DIG_Grp_Mode

DIG_Block_Out

DIG_Block_Check

NIDAQYield

DIG_Block_Clear

Pin Connection Information

The digital signals will be on ports 0 and 1. Connect the ground reference to the DIG GND pin. Connect the handshaking signal to the appropriate handshaking I/O pin (please refer to your hardware user manual for details)

[For further I/O connection details, please refer to your hardware User Manual.]


SCXI_AIonePoint
Example: SCXI_AIonePoint

Description

Read one channel, one point at a time, immediately from an SCXI analog input module.  This example can easily be extended to be useable with an SCXI-1140 module, utilizing the Track-and-Hold capabilities.

Example Category

SCXI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iOnDevChan, iChassisID, iModuleSlot, iModuleChan

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCXI_Load_Config

NIDAQErrorHandler

SCXI_Single_Chan_Setup

NIDAQDelay

AI_Read

SCXI_Scale

Pin Connection Information

Connect your analog signal to channel 0 of your SCXI module in chassis 1, slot 1.  Make sure the connection to your DAQ device is setup correctly.

[For further I/O connection details, please refer to your hardware User Manual.]


SCXI_AOVoltWrite
Example: SCXI_AOVoltWrite

Description

Output a single analog voltage from an SCXI analog output module, immediately (5 Volts, then 0 volts)

Example Category

SCXI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iChassisID, iModuleSlot, iChan, iOpCode, iRangeCode

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCXI_Load_Config

NIDAQErrorHandler

SCXI_AO_Write

Pin Connection Information

Your analog output voltage signal will be on channel 0 of the SCXI analog output module in chassis 1, slot 1.  Connect your ground reference as well. Make sure the connection to your DAQ device is setup correctly.

[For further I/O connection details, please refer to your hardware User Manual.]


SCXI_AOCurrentWrite
Example: SCXI_AOCurrentWrite

Description

Output a single analog current from an SCXI analog output module, immediately (first 5mA, then 0 mA)

Example Category

SCXI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iChassisID, iModuleSlot, iChan, iOpCode, iRangeCode

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCXI_Load_Config

NIDAQErrorHandler

SCXI_AO_Write

Pin Connection Information

Your analog output current signal will be on channel 0 of the SCXI analog output module in chassis 1, slot 1.  Connect your ground reference as well. Make sure the connection to your DAQ device is setup correctly.

[For further I/O connection details, please refer to your hardware User Manual.]


SCXI_DIonePoint
Example: SCXI_DIonePoint

Description

Reads the state of a single digital line/relay on an SCXI digital input module, immediately

Example Category

SCXI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iChassisID, iModuleSlot, iChan

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCXI_Load_Config

NIDAQErrorHandler

SCXI_Get_State

Pin Connection Information

Connect your digital signal to the SCXI digital input module in chassis 1, slot 1.  Connect your ground reference as well.  Make sure the connection to your DAQ device is setup correctly.  Note that some digital input modules may require an external voltage source for Vcc.

[For further I/O connection details, please refer to your hardware User Manual.]


SCXI_DOonePoint
Example: SCXI_DOonePoint

Description

Outputs a HIGH(ON) and LOW(OFF) to a single digital line/relay on an SCXI digital output module, immediately

Example Category

SCXI

Example Task Types

1PT, 1CH, IMMED

List of key parameters

iChassisID, iModuleSlot, iChan

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCXI_Load_Config

NIDAQErrorHandler

SCXI_Set_State

NIDAQDelay

Pin Connection Information

Your digital signal will be on channel 0 of the SCXI digital output module in chassis 1, slot 1. Connect your ground reference as well. Make sure the connection to your DAQ device is setup correctly. Note that some digital input modules may require an external voltage source for Vcc.

[For further I/O connection details, please refer to your hardware User Manual.]


SCXI_FREQonePoint
Example: SCXI_FREQonePoint

Description

Read one channel, one point at a time, immediately from an SCXI-1126 frequency input module.  This example adds special function calls to set input frequency range, cutoff frequency and voltage threshold (2.1V for TTL). (Only for the SCXI-1126 module)

Example Category

SCXI

Example Task Types

BUF, 1CH, IMMED, FREQM

List of key parameters

iOnDevChan, iChassisID, iModuleSlot, iModuleChan, dSCXIfreqRange, dThreshHold, dHysteresis, iFilterMode, dFilterFreq

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCXI_Load_Config

NIDAQErrorHandler

SCXI_Single_Chan_Setup

SCXI_Set_Gain

SCXI_Configure_Filter

SCXI_Set_Threshold

DAQ_Op

SCXI_Scale

NIDAQPlotWaveform

NIDAQMean

Pin Connection Information

Connect your analog signal to channel 0 of your SCXI module in chassis 1, slot 1.  Make sure the connection to your DAQ device is setup correctly.

[For further I/O connection details, please refer to your hardware User Manual.]


SCXI_SCANsingleBuf
Example: SCXI_SCANsingleBuf

Description

Read 4 channels at the SAME gain from an SCXI analog input module into a buffer, using internal scan and sample timing. The DAQ device must have a scan clock and a channel clock. NOTE: This example is NOT suitable for the SCXI-1122 module, which uses a relay multiplexer.  For the SCXI-1122 module, sample a buffer of data on one channel, then call SCXI_Change_Chan to sample another channel. Also, if you are using this example with an SCXI-1100, make sure the filter setting is set to NO FILTER, so that the signals can settle properly.

Example Category

SCXI

Example Task Types

BUF, NCH, INTTIM, SYNC

List of key parameters

iNumModules, piModuleList, piNumChans, piStartChans, iMuxCtrON, uCtrValue

[Since variables are hardcoded, there is no guarantee that this program will work for your setup.  This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.]

List of NI-DAQ Functions used in this example

SCXI_Load_Config

NIDAQErrorHandler

SCXI_SCAN_Setup

Timeout_Config

SCXI_MuxCtr_Setup

SCAN_Op

SCAN_Demux

SCXI_Scale

NIDAQPlotWaveform

Pin Connection Information

Connect your analog signals to channels 0 through 3 of your SCXI module in chassis 1, slot 1. Make sure the connection to your DAQ device is setup correctly.

[For further I/O connection details, please refer to your hardware User Manual.]