K-BOXManual
K-BOX: digital measurement modes
Turn K-BOX's digital inputs into CAN measurements. Pick the mode that suits your signal and set its rate and edge. Each mode below shows how precise the result is.
Choose a measurement mode
Digital 1 to 3 measure signals. K-BOX processes each one and sends the result in its own CAN message, for example a pulse duration on CAN ID 0x310. Digital 4 has no measurement modes.
| Channel | CAN connector pin |
|---|---|
| Digital 1 | 4 |
| Digital 2 | 8 |
| Digital 3 | 6 |
The inputs measure signals up to 100 kHz, with pulses of at least 100 ns and at least 10 µs between pulses. For voltage limits and thresholds, see K-BOX: connector pinouts.
- Open the Digital Channels tab. Select Load to read the current settings.
- Choose the mode. Select it from the Function list of the channel.
- Set where the result goes. Choose the CAN ID and the Rate at which K-BOX sends it.
- Choose the edge. For pulse duration, duty cycle, events and RPM, select Rising or Falling.
- Select Commit, then Export. K-BOX stores the settings and K-CAL writes a DBC file that decodes the new messages.

Watch: How to assign digital functions using K-CAL (0:53)
Digital input states
K-BOX also reports the plain logic level of its digital inputs. It sends a message on the Digital Inputs Status CAN ID at the rate you set, for example 0x300 every 100 ms. The first byte of the message holds the levels. The DBC file names the bits.
Pulse duration
Choose Pulse duration to measure how long a pulse lasts. Choose the edge on which the measurement starts. With Rising, K-BOX times the high part of the signal. With Falling, it times the low part.
K-BOX sends a message only when a measurement is complete, even if the rate interval has passed. It also stretches the message interval when needed so the CAN bus does not overload. With a 2000 Hz signal (0.5 ms period) on a 125 kbit/s bus that is not overloaded, the rate sets the interval as in the table.
| Rate | Message interval |
|---|---|
| 50 ms | Every 50 ms |
| 1 ms | Every 2 ms |
Frequency
Choose Frequency to measure an averaged frequency. K-BOX counts the pulses during each rate interval and scales the count to one second:
Frequency (Hz) = 1 s × N pulses / Rate
If the frequency changes during the interval, the result is the average. A longer rate gives a finer result. At a rate of 1000 ms, the frequency resolves to 1 Hz.
Worked example
- Rate: 100 ms.
- The sensor runs at 10 kHz for 60 ms: K-BOX counts 600 pulses.
- It then runs at 8 kHz for 40 ms: K-BOX counts 320 more.
- Over the 100 ms interval K-BOX counts 920 pulses: 1 s × 920 / 100 ms = 9.2 kHz.
High frequency
Choose High Frequency for fast signals. It works like the frequency mode. K-BOX counts pulses over the rate interval, scales the count to one second and averages any change within the interval. The same 9.2 kHz example applies.
Cycle duration
Choose Cycle duration to measure the period T of one cycle. You can then calculate the frequency:
F = 1 / T
This is the instantaneous frequency of one cycle, not an average. K-BOX waits for the cycle to finish before it sends the duration, so a long cycle can make messages slower than the rate you set. If a cycle is shorter than the rate interval, K-BOX recalculates the duration before it sends it.
Duty cycle and PWM
Choose Duty cycle/PWM to measure the duty cycle of a PWM signal. K-BOX measures the period T between two starting edges. It also measures the time P from a starting edge to the next edge, and reports P / T.
Choose the starting edge that the modulation does not move:
- If the modulation is on the falling edge, choose Rising. A signal that is high for a quarter of each period then reads 0.25.
- If the modulation is on the rising edge, choose Falling.
With the wrong edge the measured period moves with the modulation, and the same signal reads 0.75 instead of 0.25. K-BOX changes the message rate for this mode when needed so the CAN bus does not overload.
Event counter
Choose Event counter to count edges. Choose Rising or Falling. The counter increases by one on every edge of that kind. The counter resets when K-BOX is power cycled or receives a new configuration.
RPM
Choose RPM to measure revolutions per minute. Choose the edge on which K-BOX counts. K-BOX counts the pulses during each rate interval and scales the count to one minute:
RPM = 60 s × N pulses / Rate
If the speed changes during the interval, the result is the average. The example below assumes one pulse per revolution.
Worked example
- Rate: 500 ms.
- The sensor turns at 2000 rpm for 300 ms: K-BOX counts 10 pulses (2000 × 0.3 s / 60 s).
- It then turns at 4800 rpm for 200 ms: K-BOX counts 16 more (4800 × 0.2 s / 60 s).
- Over the 500 ms interval K-BOX counts 26 pulses: 60 s × 26 / 0.5 s = 3120 rpm.
Each pulse is worth 60 s / Rate, so the result moves in steps of 120 rpm at a 500 ms rate and 60 rpm at a 1000 ms rate.
Instantaneous RPM
To measure a low speed precisely, set the channel to Cycle duration and calculate the instantaneous speed of one revolution from its period T in seconds:
RPM = 60 / T
As with any cycle duration, K-BOX sends the value only when the revolution is complete.
Products in this guide
Still stuck?
Our engineers answer support questions on every Influx Technology product.