PWM Measure block for PCI-6259, PCIe-6259, PXI-6259, and PXIe-6259 boards
Simulink® Real-Time™ Library for National Instruments®
Use this block to measure the pulse width or the period of a signal.
To measure the pulse width of a signal, connect the signal to the gate, as follows:
|0||PFI 9 (Pin 3)|
|1||PFI 4 (Pin 41)|
The input waveform must have fast rise and fall times and conform to TTL signal levels of [0,5] volts. Use external signal conditioning to achieve these levels. If you input a sine wave, the decision points are less definite and the measurement is noisy. In extreme cases, the gate can transition multiple times during a slow signal transition.
This block does not queue or buffer measurements. If the gate changes state, the driver holds the current count, overwriting the previous value.
This block returns the length of the last gate period before the block executes.
To compute the duty cycle percentage, use two counters. Because the period of a cycle is H counter + L counter, you can measure two of these counters and compute the third.
You cannot measure a 0 width pulse.
From the list, select a counter,
From the list, select the gating mode to use:
|Returns the number of 80 MHz cycles that occur when a single cycle of the input is high.|
|Returns the number of 80 MHz cycles that occur when a single cycle of the input is low.|
|Returns the number of 80 MHz cycles that occur between rising edges of the input signal. This cycle is the full period of the input signal.|
|Returns the number of 80 MHz cycles that occur between falling edges of the input signal. This cycle is the full period of the input signal.|
If the input signal has both fast rise and fall edges,
Rising Edges and
Between Falling Edges return
the same value. If the input is asymmetric, one of these options can
give a better result than the other.
You can apply a digital debouncing filter to the input pins before processing.
From the list, select a filter value to ignore pulses that are
shorter than the filter time. The block ignores pulses shorter than
the chosen duration. The value of
that the input is not filtered
Minimum pulse width 125 nanoseconds
Minimum pulse width 6.25 microseconds
Minimum pulse width 1.25 milliseconds
Enter the base sample time or a multiple of the base sample
-1 means sample time is inherited).
If only one board of this type is in the target computer, enter
locate the board.
If two or more boards of this type are in the target computer,
enter the bus number and the PCI slot number of the board associated
with this driver block. Use the format
To determine the bus number and the PCI slot number, type:
tg = slrt; getPCIInfo(tg, 'installed')