Exercise_4

Exercise_4 - Exercise 4 A&EP 264 Fall 2007 Digital...

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

View Full Document Right Arrow Icon
Digital Input/Output (I/O) In this exercise you will learn how to operate the digital output and digital input ports of the NI 6221 DAQ card. We will use the Digital_input.cpp and Digital_output.cpp programs given below. Consult NIDAQ C Reference Help in the A&EP 264 folder for details on the native C functions used in these programs. /* Digital_input.cpp */ #include <stdio.h> // printf() #include <NIDAQmx.h> // NIDAQ native C functions #include <conio.h> // _kbhit() int main(void) { TaskHandle taskHandle=0; uInt32 data; int32 read; /*********************************************/ // DAQmx Configure Code /*********************************************/ DAQmxCreateTask("",&taskHandle); DAQmxCreateDIChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines); /*********************************************/ // DAQmx Start Code /*********************************************/ DAQmxStartTask(taskHandle); /*********************************************/ // DAQmx Read Code /*********************************************/ while(!_kbhit()){
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.

Page1 / 3

Exercise_4 - Exercise 4 A&EP 264 Fall 2007 Digital...

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