GET_RMS
Syntax
GET_RMS <ch> or GET_RMS ALL
Description
Reads the RMS value of one channel, or of all channels at once. Values are in raw sample counts. The RMS must have been started with RMS ON (or SPIKE ON).
Parameters
| Parameter | Description |
|---|---|
<ch> | Channel number, 0 to channels − 1. |
ALL | All streamed channels. |
Response
One channel:
RMS <ch> <value> ready=<0|1> seq=<n>
All channels, one value per streamed channel:
RMS <v0> <v1> <v2> ... <v(N-1)>
ready=1 means the window is full and the estimate is stable. seq is an update counter.
Errors
| Reply | Condition |
|---|---|
ERR GET_RMS bad_arg | Missing argument or channel out of range. |
Example
get_rms.py
from hmcls_udp import Board
board = Board("192.168.1.11")
line = board.query("GET_RMS ALL")[0]
values = [int(v) for v in line.split()[1:]]
print(f"{len(values)} channels, max RMS = {max(values)}")