Edge timing and edge counting

Edge time, period, and counts can be measured on P or C terminals. Feedback control using pulse-width modulation (PWM) is an example of an edge timing application.

Single edge timing

A single edge or state transition can be measured on C terminals. Measurements can be expressed as a time (µs), frequency (Hz) or period (µs).

CRBasic instruction: TimerInput()

Multiple edge counting

Time between edges, time from an edge on the previous terminal, and edges that span the scan interval can be measured on C terminals. Measurements can be expressed as a time (µs), frequency (Hz) or period (µs).

  • CRBasic instruction: TimerInput()

Timer input NAN conditions

ClosedNAN Not a number. A data word indicating a measurement or processing error. Voltage overrange, SDI-12 sensor error, and undefined mathematical results can produce NAN. is the result of a TimerInput() measurement if one of the following occurs:

  • Measurement timer expires
  • The signal frequency is too fast

For more information, see: