National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 10 Easy I/O for DAQ Library
© National Instruments Corporation 10-29 LabWindows/CVI Standard Libraries
sourceEdge is the edge of the counter source or timebase signal on which it increments, and this
parameter accepts the following attributes:
COUNT_ON_RISING_EDGE
COUNT_ON_FALLING_EDGE
gateMode specifies how the signal on the counter's GATE pin is used. The options are:
UNGATED_SOFTWARE_START
—ignore the gate signal and start when
CounterStart
is
called.
COUNT_WHILE_GATE_HIGH
—count while the gate signal is TTL high after
CounterStart
is called.
COUNT_WHILE_GATE_LOW
—count while the gate signal is TTL low after
CounterStart
is called.
START_COUNTING_ON_RISING_EDGE
—start counting on the rising edge of the TTL
gate signal after
CounterStart
is called.
START_COUNTING_ON_FALLING_EDGE
—start counting on the falling edge of the TTL
gate signal after
CounterStart
is called.
CounterMeasureFrequency
short
error = CounterMeasureFrequency (
short
device,
char
counter
[]
,
unsigned short
counterSize,
double
gateWidthSampleTimeinSec,
double
maxDelayBeforeGateSec,
unsigned short
counterMinus1GateMode,
double *
actualGateWidthSec,
short *
overflow,
short *
valid,
short *
timeout,
double *
frequency);
Purpose
Measures the frequency of a TTL signal on the specified counter's SOURCE pin by counting
rising edges of the signal during a specified period of time. In addition to this connection, you
must also wire the counter's GATE pin to the OUT pin of counter-1. For a specified Counter,
Counter-1 and Counter+1 are defined as shown in Table 10-4.