Exercise_2 - Exercise 2, A&EP 264, Fall 2007 Analog to...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Analog to Digital Conversion Step 1: Before beginning this exercise, be sure to read the course document Introduction to DAQmx data acquisition programming posted on the AEP264 course blackboard. You must also read the documents Using the Protoboard and Using Visual Studio before beginning this exercise. In this exercise we will use the program “ADC_example.cpp” to record voltages on two of the 16 analog input channels available on the NI 6221 DAQ card. Here is the program. Consult NIDAQ C Reference Help in the A&EP 264 folder for details on the native C functions used in this program. /* ADC_example.cpp */ /* This program reads voltages on one or more of the 16 ADC channels available on the NI-6122 multipurpose DAQ card. Channel voltages are read in sequence at the sampling rate of the ADC (ca. 250 kHz). The sequence is displayed on the computer screen and refreshed at a user-selected time interval using the delay() function. No error checking is included */ #include <stdio.h> // printf() #include "NIDAQmx.h" // NIDAQ native C functions #include <windows.h> // GetTickCount() #include <conio.h> // _kbhit() // delay function prototype: void delay(int); void main(){ TaskHandle task=0; // Task variable float64 data[16]; // Data variable int i=0; int32 dataArraySize = 1; /* Select the number of ADC channels to use for your
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/04/2008 for the course AEP 2640 taught by Professor Cool during the Spring '08 term at Cornell University (Engineering School).

Page1 / 6

Exercise_2 - Exercise 2, A&amp;EP 264, Fall 2007 Analog to...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online