Skip to main content

SETUP

Syntax​

SETUP or SETUP DEFAULTS

Description​

Configures the acquisition hardware with the board's current settings (sampling rate, LOWER, UPPER, DSP) and fixes the number of channels. SETUP must be done before START, and again after anything that invalidates it: a headstage change, SET_CHANNELS, or a switch of acquisition mode.

SETUP DEFAULTS first resets LOWER, UPPER and DSP to their default values, then configures the hardware.

SETUP must be sent while acquisition is stopped. It takes a moment (allow up to 5 seconds before giving up). A headstage must be connected, except in simulation mode.

The HMCLS app sends SETUP automatically when the board reports state=needs_setup; you only need to send it yourself from your own scripts.

Response​

The reply tells what has actually been applied:

OK SETUP fs=<Hz> lower=<Hz> upper=<Hz> dsp=<0|1> dsp_hz=<Hz> channels=<n> setup=1 config_id=<n>

The fields are the ones of GET_CONFIG. A EVT config event is also sent to the owner when the configuration changed.

Errors​

ReplyCondition
ERR SETUP runningAcquisition is running. Send STOP first.
ERR SETUP busyAnother operation (for example an impedance scan) is in progress.
ERR SETUP no_headstageNo headstage is connected.

Example​

setup.py
from hmcls_udp import Board

board = Board("192.168.1.11")
board.request("STOP")
cfg = board.request("SETUP", timeout=5.0)
print("ready:", cfg["channels"], "channels at", cfg["fs"], "Hz")
board.request("START")