Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Syncronizing 4 counters and Timestamping Values to GPS

Hi,
 
I'm trying to timestamp the Frequency, Pulse Width, and Edge Count of a TTL signal.  The signal is the same throughout.  I'm using the 6608 timing card.  And each measurement is on a different counter.  What I'm having difficulties with is timestamping these values to GPS.  Do these measurements have to be synchonized?
 
My current program entails 4 while loops - one for each measurement and another to acquire GPS time.  Each loop was created using Daqmx.  Attached is what I'm working on.
 
Thanks.
 
--cj
0 Kudos
Message 1 of 3
(3,307 Views)
cmiranda,

Are you measuring the same signal with each of these counters? I opened your VI, but the configuration sub VIs were missing. If this is the case, you could get away with using a single counter. A semi-period measurement would output the high and low times, giving you pusle width, and with a little calculation, frequency as well. Additionally, since this measurement is taken on every pulse, the size of your output array (or in this case half the size, because the data comes out high time, low time, high time... etc.) would give you the number of pulses. Finally, I noticed you had a signal connection for your GPS on the fron panel of your VI, PFI 30, but you don't have the gps counter gate connected to anything. What signal are you connecting there? Whatever you connect to the gate will cause a timestamp to be generated. If this is all the same signal, you could connect it to the gate so the timestamp corresponds to the exact pulse of the signal. You may want to look at the DAQmx Connect Terminals VI which would allow you to internally route signals rather than making separate physical connections.

Additionally, I noticed that in the loops in your VI you were using auto-indexing. This will actually create a 2 dimensional array rather than a single array, which is what I assume you want. Try using a shift register and a Build Array VI instead. Again, if this is the same signal we are measuring, I would put everything in one large while loop to simplify the code.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 3
(3,295 Views)
cmiranda,

I just noticed that your GPS measurement was software timed. You'll need a hardware timed mesurement to do what I suggested. Please take a look at the "Meas GPS Timestamp-Buffered-Finite LabVIEW" shipping example. The sample clock source will be your signal, and you have the ability to select whether you want to timestamp on the rising or falling edge.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 3 of 3
(3,290 Views)