Semi-Period Measurement
- Updated2024-12-11
- 2 minute(s) read
In semi-period measurements, the counter measures a semi-period on its Gate input signal after the counter is armed. A semi-period is the time between any two consecutive edges on the Gate input.
You can route an internal or external periodic clock signal (with a known period) to the Source input of the counter. The counter counts the number of rising (or falling) edges occurring on the Source input between two edges of the Gate signal.
You can calculate the semi-period of the Gate input by multiplying the period of the Source signal by the number of edges returned by the counter.
Refer to the following sections for more information about semi-period measurement options.
Single Semi-Period Measurement
Single semi-period measurement is equivalent to single pulse-width measurement.
Implicit Buffered Semi-Period Measurement
In implicit buffered semi-period measurements, on each edge of the Gate signal, the counter stores the count in the FIFO. The NI ASIC transfers the sampled values to host memory using a high-speed data stream.
The counter begins counting when it is armed. The arm usually occurs between edges on the Gate input. You can select whether to read the first active low or active high semi-period using the CI.SemiPeriod.StartingEdge property in NI-DAQmx.
The following figure shows an example of an implicit buffered semi-period measurement.
For information about connecting counter signals, refer to the Default Counter/Timer Routing section.
Pulse versus Semi-Period Measurements
In hardware, pulse measurement and semi-period are the same measurement. Both measure the high and low times of a pulse. The functional difference between the two measurements is how the data is returned. In a semi-period measurement, each high or low time is considered one point of data and returned in units of seconds or ticks. In a pulse measurement, each pair of high and low times is considered one point of data and returned as a paired sample in units of frequency and duty cycle, high and low time or high and low ticks. When reading data, 10 points in a semi-period measurement will get an array of five high times and five low times. When you read 10 points in a pulse measurement, you get an array of 10 pairs of high and low times.
Also, pulse measurements support sample clock timing while semi-period measurements do not.