Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronously writing counter values

Hello,

I program a device driver for the NI6602 card on the Real Time Operations System QNX by using the Register Level Manual and the DDK.

I want to measure highly dynamic signals from 1Hz to 1MHz. Currently I use the Pulse-Width Measurement to measure the input frequencies.
In the high frequency range the values seems to be inaccurate. Therefore, my idea is to use two counter for the measurment.
The first counter performs the Pulse-Width Measurement for low frequency range and the second counter performs the Event-Counting Measurement
for the high frequency range.
How do I program the second counter so that both counters are writing there values synchronously to there HW_SAVE_Register ?

Best regards Uwe
0 Kudos
Message 1 of 2
(5,235 Views)

I only program counters from LabVIEW, but I'm pretty sure that what you want to do isn't possible.

I wouldn't call it a limitation of the hardware, it's more in the concept of the different types of

measurement.

 

Measurements like pulse widths and periods will latch their values into the hardware register on active

edges of the signal being measured.   This will likely happen at an unpredictable and variable rate,

otherwise, why measure?

 

Measurements like event counting will latch their values into the hardware register on active edges

of the sample clock.  This should happen at a known and constant rate so you can interpret that

# of edges as a rate.

 

Here's what I'd do to correlate the two measurements in time:

1. Config both tasks to start off a common "arm start" trigger.

2. Measure semi-periods instead of pulse widths.  The cumulative total time of the semi-periods

gives you "time since trigger."   You won't be able to figure out this cumulative total if you only

measure pulse widths.  So measure semi-periods, even if your app doesn't want to care about

half that data.

3. Do event counting at a constant sample rate.  Then (sample #) / (sample rate) gives you "time

since trigger."

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(5,224 Views)