NI-DAQmx: time loop when Digital Input Change Detection and read digital level
This example demonstrates how to time loop and read values from one or more digital input channels using change detection. T
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.
Application Software: LabVIEW Full Development System 8.6
Hardware Group: Digital I/O (DIO), Multifunction DAQ (MIO)
Driver: NI-DAQmx 8.8
Reader Comments | Submit a comment »