NI-DAQmx: time loop when Digital Input Change Detection and read digital level
Overview
This example demonstrates how to time loop and read values from one or more digital input channels using change detection. T
Downloads
Filename: changedetectiontimedloop.vi
Requirements: View
This example demonstrates how to time loop and read values from one or more digital input channels using change detection.
-----------------------------
Block Diagram Steps
-----------------------------
1. Create a Digital Input channel. Use one channel for all lines. You can alternatively use one channel for each line, but then use a different polymorphic version of the DAQmx Read VI.
2. Setup the Change Detection timing for the acquisition. The timing is set to read continuously. The Rising Edge Lines and Falling Edge Lines specify on which digital lines a change causes a sample to be read.
3. Create a timing source based on the change detection digital input for the timed loop
4. Configure a timing source
5. Read the digital data in a loop until the user hits the stop button or an error occurs. This read VI reads Samples Per Read samples of digital data every time through the loop. Also set a timeout so an error is returned if the samples are not returned within the specified time limit. Because this example uses change detection, 10 seconds was chosen as an arbitrarily large number to allow for changes to occur.
6. Call the Clear Task VI to clear the task.
Requirements
Filename: changedetectiontimedloop.vi
Software Requirements
Application Software: LabVIEW Full Development System 8.6
Language(s): LabVIEW
Hardware Requirements
Hardware Group: Digital I/O (DIO), Multifunction DAQ (MIO)
Driver: NI-DAQmx 8.8
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
