Skip to main content

DEEP_ZCHECK

Syntax​

DEEP_ZCHECK <N> <M> [ch]

Description​

Runs a multi-frequency impedance sweep (Bode diagram). For each channel, the board measures impedance and phase at N logarithmically spaced frequencies between 100 Hz and 20 kHz, averaging M measurements per point, over three measurement ranges. Acquisition must be stopped.

A sweep of all channels takes a long time (up to several minutes for large N and M). The lines are sent to the PC that sent the command as they are measured; the board state is busy meanwhile.

Parameters​

ParameterTypeRangeDescription
<N>integer1–64Number of frequency points.
<M>integer1–64Measurements averaged per point.
[ch]integer0 – channels − 1Optional: sweep a single channel. Without it, all acquired channels are swept.

Response​

DEEP_ZCHECK_BEGIN <channel_count> <N>
DZ <ch> <f_nom> <f_actual> <z0> <ph0> <fl0> <z1> <ph1> <fl1> <z2> <ph2> <fl2>
...
DEEP_ZCHECK_END
FieldDescription
DEEP_ZCHECK_BEGIN <channel_count> <N>Announces how many channels and frequency points follow.
<ch>Channel index.
<f_nom>Nominal frequency in Hz.
<f_actual>Frequency actually measured, in Hz.
<z0>, <z1>, <z2>Impedance magnitude in kΩ for measurement ranges 0, 1 and 2.
<ph0>, <ph1>, <ph2>Phase in degrees for each range.
<fl0>, <fl1>, <fl2>Status of each range: 0 = OK, non-zero = measurement issue.
DEEP_ZCHECK_ENDThe sweep is complete.

Errors​

ReplyCondition
ERR DEEP_ZCHECK runningAcquisition is running. Send STOP first.
ERR DEEP_ZCHECK busyAnother operation is in progress.
ERR DEEP_ZCHECK bad_argN or M missing or outside 1–64.

Example​

deep_zcheck.py
from hmcls_udp import Board

board = Board("192.168.1.11")
board.request("STOP")

rows = []
for line in board.query("DEEP_ZCHECK 16 4 0", timeout=30.0): # channel 0 only
parts = line.split()
if parts and parts[0] == "DZ":
ch, f_nom, f_act = int(parts[1]), int(parts[2]), float(parts[3])
z0, ph0, fl0 = float(parts[4]), float(parts[5]), int(parts[6])
rows.append((f_nom, z0, ph0, fl0))

for f_nom, z, ph, flag in rows:
print(f"{f_nom:6d} Hz Z={z:.2f} kOhm phase={ph:.1f} deg flag={flag}")