Easy I/O for DAQ Library Chapter 10
LabWindows/CVI Standard Libraries 10-48 © National Instruments Corporation
PulseWidthOrPeriodMeasConfig
short error = PulseWidthOrPeriodMeasConfig (short device, char counter[],
unsigned short typeOfMeasurement,
double sourceTimebase,
unsigned long *taskID);
Purpose
Configures the specified counter to measure the pulse width or period of a TTL signal connected
to its GATE pin. The measurement is done by counting the number of cycles of the specified
timebase between the appropriate starting and ending events.
Connect the signal you want to measure to the counter's GATE pin.
To measure with an internal timebase, set sourceTimebase to the desired frequency.
To measure with an external timebase, connect that signal to counter's SOURCE pin and set the
sourceTimebase parameter to USE_COUNTER_SOURCE.
Call CounterStart to start the measurement. Then call CounterRead to read the value. A
valid count value is greater than 3 without overflow.
Parameters
Input device short
integer Assigned by configuration utility.
counter string The counter to be used for the counting
operation.
typeOfMeasurement unsigned
short
integer
Identifies the type of pulse width or period
measurement to make.
sourceTimebase double USE_COUNTER_SOURCE: count TTL edges
at counter’s SOURCE pin; or supply a valid
internal timebase frequency to count the TTL
edges of an internal clock.
Output taskID unsigned
long integer The reference number assigned for the counter
reserved for this operation. You pass taskID
to CounterStart, CounterRead, and
CounterStop.
Return Value
error short integer Refer to error codes in Table 10-5.