National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference CTR_EvRead
©
National Instruments Corporation 2-95 NI-DAQ FRM for PC Compatibles
Using This Function
CTR_EvRead reads the current value of the counter without disturbing the counting process
and returns the value in count.
CTR_EvRead also performs overflow detection and returns the
overflow status in overflow. Overflow detection and the significance of count depend on the
counter configuration.
Special Considerations for Overflow Detection
For NI-DAQ to detect an overflow condition, you must configure the counter for TC toggled
output type and positive output polarity, and then you must configure the counter to stop
counting on overflow (cont = 0 in the
CTR_EvCount call). If these conditions are not met, the
value of overflow is meaningless. If more than one counter is concatenated for event-counting
applications, you should configure the lower-order counters to continue counting when
overflow occurs, and overflow detection is only meaningful for the highest order counter.
count, returned by
CTR_EvRead for the lower-order counters, then represents the module
65,536 event count. See Event-Counting Applications in Chapter 3, Software Overview, in the
NI-DAQ User Manual for PC Compatibles for more information.