Difference Between Counter Output and Counter Terminal Count

Updated Apr 18, 2023

Issue Details

Both DAQ-STC and NI-TIO counter chips offer many options when it comes to signal routing. I noticed that in some attributes, like Source selection, you can set Counter TC as the signal source; while in others, like Gate selection, the legal value is Counter Output. What are the differences between these two signal sources?

Solution

The Counter Output signal, available on the I/O connector, is generated by the Counter TC (Terminal count), which is an internal signal. 

The Counter TC signal is generated when the counter reaches its terminal count (maximum or minimum value). The Counter TC pulse remains high during a timebase period. This signal is not accessible on the I/O connector, although the Counter Output signal can reflect the same behavior. The Counter Output outputs the Counter TC signal after the output mode (toggle or pulse) and polarity are selected. The resulting signal is available on the I/O connector. In Pulse mode, the Counter Output reflects the Counter TC signal. In Toggle mode, the output signal changes state on a trailing edge of the Counter TC signal. 

Additional Information

The subtle difference in the behavior of these two modes can cause unexpected results in some applications. Sometimes, it is necessary to specify a custom timebase in an application. A common way to obtain a stable and configurable timebase is to generate a continuous pulse train in one counter. The second counter would set the Source Selection attribute to other Counter TC. With this setup, the timebase used by the second counter is twice the specified pulse train frequency. 

The counter determines the time the output is high or low by counting down from a value specified by the user. When the counter reaches zero a TC pulse is generated. Since in this configuration the output mode is set to toggle, each TC pulse toggles the output state. Each transition seen in the external output pin results from a complete TC pulse. To find out which external pin is associated with this output for your device, follow the instructions in this link.  Since the counter is using the Counter TC signal instead of the Counter Output signal, the source will receive a rising edge for each transition (rising or falling) of the output signal.