National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 10 Easy I/O for DAQ Library
© National Instruments Corporation 10-39 LabWindows/CVI Standard Libraries
timebaseDivisor is the source frequency divisor. For example, if the source signal is 1000 Hz,
the timebaseDivisor is 10, and the output is pulsed, the frequency of the counter's OUT signal is
100 Hz. If the output is toggled, the frequency is 50 Hz.
gateMode specifies how the signal on the counter's GATE pin is used. This parameter accepts
the following attributes:
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.
outputBehavior is the behavior of the output signal when counter reaches terminal count. This
parameter accepts the following attributes:
HIGH_PULSE—high pulse lasting one cycle of the source or timebase signal.
LOW_PULSE—low pulse lasting one cycle of the source or timebase signal.
HIGH_TOGGLE—high toggle lasting until the next TC.
LOW_TOGGLE—low toggle lasting until the next TC.
For a Timebase Divisor of N and a pulsed output, an output pulse equal to the period of the
source or timebase signal appears on counter's OUT pin once each N cycles of that signal For a
toggled output, the output toggles after each N cycles. The toggled output frequency is thus half
that of the pulsed output, in other words,
pulsedFrequency = sourceFrequency/ N
and
toggledFrequency = sourceFrequency/(2*N)
thus, if N =3, the OUT pin would generate pulses as follows:
_ _ _ _ _ _ _ _ _ _ _ _
source _| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |
___ ___ ___ ___
HIGH_PULSE _| |_______| |_______| |_______| |______
___________ ___________
HIGH_TOGGLE _| |___________| |_________