12-05-2011 04:32 PM
I am using a PCI-6132 to time digital signals. Ideally, I would like to use the NI-DAQmx C++ API to get a timestamp from the 6132 for each edge (essentially, input capture). I'm pretty sure there is a way to configure a task to do this, but I'm not quite sure how. Most of the tasks seem to measure relative times (ie, the time between two pulses, high time, etc). If someone could point me to the functions/configurations that I should look at, I'd be very grateful.
Thanks,
Ruddick
12-06-2011 10:17 AM
Hi Ruddick,
I found a few examples which might help you along. Both can be found by navigating to the text-based examples provided in your DAQmx installation.
Start>>All Programs>>National Instruments>>NI DAQ>>Text-Based Code Support>>ANSI C Examples
In the folder, navigate to Events>>Signal>>Change Detection>>Read Dig Chan-Change Detection Event.c This program shows you how to create a DAQmx task which reads change detection events. During the callback phase, you can insert the code to get a timestamp.
The other example, starting with "ANSI C Examples", is located in Counter>>Measure GPS Timestamp>>GPS Timestamp.c
These two examples should give you enough to work with to create a task which outputs a timestep at each rising edge when reading channels on the PCI-6132. Please let me know if you are having trouble finding these examples, I'll be happy to attach to another reply.
Best,
Peter Rifken
Applications Engineer
National Instruments
1-866-ASK-MYNI
12-06-2011 01:32 PM
Hi Peter,
Thanks for getting back to me so quickly.
In "Read Dig Chan-Change Detection Event.c" it looks like the timestamp is the computer's when the callback is called (is this correct?). I'm trying to read the timestamp from the PCI-6132 when an edge occurs.
"GPS Timestamp.c" requires a regular input square wave to create a synchronized clock, whereas I would like to use a timestamp from the PCI-6132's clock to know when irregular edges occurred.
Is there no way to do something similar to input capture on the PCI-6132? I find it hard to believe that there is no way to get the data from the internal clock register....
12-06-2011 02:06 PM
I've reviewed your response with a colleague and you are correct, I am currently looking into a method of calling the PCI-6132's internal clock to track irregular edges. I should have looked into your post more clearly.
12-06-2011 02:33 PM
Ruddick,
This Knowledge Base article outlines your problem and some options you have to proceed:
Be sure to check out accuracy considerations by following the link at the bottom of the article, or Here
Keep me posted!
Best,