Measure contact impedance
Contact impedance tells you whether an electrode is seated. The stream carries a per-channel magnitude, not an impedance in ohms — see Impedance measurement for what separates the two.
The stream follows the same six-step lifecycle as EXG, described in Stream lifecycle. Only the feature name changes.
Add the stream
const streamId = 21;
await client.features.executeOperation("impedance", "add_stream", {
stream: {
stream_id: streamId,
protocol: "udp",
host: "127.0.0.1",
port: 9021,
elements_before_flush: 1,
},
});stream_id = 21
await client.execute_operation("impedance", "add_stream", {
"stream": {
"stream_id": stream_id,
"protocol": "udp",
"host": "127.0.0.1",
"port": 9021,
"elements_before_flush": 1,
},
})The impedance stream runs at 4 Hz, so elements_before_flush: 1 delivers one packet every 250 ms. Raising it batches several measurements per packet.
Subscribe and start
Subscribe before starting, so no packet arrives without a handler.
Read a frame
Each channel entry carries the same four fields the EXG stream uses. For the impedance feature, adc_data is the magnitude the device computed for that channel, not a voltage and not an impedance.
channel_id
number
Absolute channel, 0 to 15
adc_data
number
Signed 24-bit magnitude for this channel
has_error
boolean
Device flagged this sample
error_info
number
Device-specific error code, meaningful only when has_error is set
Channel ids are decoded from each sample word rather than from its position in the frame, so a frame that omits a channel stays correctly labelled.
Warning: Skip samples with
has_errorset. The device flags readings it could not produce, and theiradc_datais not a measurement.
Convert to ohms
The SDK does not convert magnitudes to ohms or to a contact verdict. Both conversions need inputs the SDK has no source for — a per-channel excitation current from a calibration run, and the device's quality thresholds. Impedance measurement sets out the arithmetic and what each step needs, so you can apply it to the magnitudes this stream delivers.
Clean up
Stop the stream, let the buffer drain, then unsubscribe and remove.
Packets already in flight arrive during the drain window, so keep the handler able to run until the unsubscribe returns.
Next steps
Last updated
Was this helpful?

