How Can I Use the Second Pulse from a Periodic Digital Source to Trigger an Analog Input Task

Updated Jun 12, 2018

Reported In

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

I am using the Z terminal of an encoder to trigger one Analog Input task but I want to use the second pulse generated on this terminal.

Solution

There is one way to skip the first pulse to use another one to trigger your task. After you add the trigger and set the trigger source, follow the next steps:

 

1- Commit the task using "DAQmx Control Task. VI " after the "DAQmx Trigger. VI "

2- Start the task with the first pulse

3- Clean the buffer with the "DAQmx Read. VI " using a "-1" constant in the number of samples, to read everything in the buffer.

4- Stop the task

5- Use the "DAQmx Property Node" to check that there are not available samples on the buffer

6- Start the task again

The next image shows how this configuration looks like:



Attached you can find an example of this modification implemented.

Attachments

WAS THIS ARTICLE HELPFUL?

Not Helpful