Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp/time elapsed for digital pulses

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

0 Kudos
Message 1 of 5
(6,008 Views)

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

www.ni.com/support

1-866-ASK-MYNI

 

 

 

--
Peter Rifken - Field Engineer & Business Manager
Boston / North New England & Maine
0 Kudos
Message 2 of 5
(6,002 Views)

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....

0 Kudos
Message 3 of 5
(5,998 Views)

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. 

--
Peter Rifken - Field Engineer & Business Manager
Boston / North New England & Maine
0 Kudos
Message 4 of 5
(5,995 Views)

Ruddick, 

 

This Knowledge Base article outlines your problem and some options you have to proceed:

 

How Do I Get a DAQmx Timestamp in LabWindowsTM/CVI?

(Link Here)

 

Be sure to check out accuracy considerations by following the link at the bottom of the article, or Here

 

Keep me posted!

 

Best,

--
Peter Rifken - Field Engineer & Business Manager
Boston / North New England & Maine
0 Kudos
Message 5 of 5
(5,991 Views)