STATUS
Syntax
STATUS
Description
Returns a one-line snapshot of the acquisition state, the data stream and the network link. Useful to monitor a live session and to spot a network that cannot keep up.
Response
STATUS <RUN|STOP> <key> <value> <key> <value> ...
The line is a state followed by key value pairs. The fields below are supported; the line also carries diagnostic fields that you should ignore.
| Field | Description |
|---|---|
RUN / STOP | Whether acquisition is running. |
stream_sps | Rows per second actually delivered on the data stream. |
buf_drop | Data buffers dropped because the network could not keep up (non-zero = overload). |
tx_fail | Failed transmissions. |
netif_link | 1 = network link up, 0 = down. |
phy_state | Link state: 1 down, 2 100 Mb/s full duplex, 3 100 Mb/s half duplex, 4 10 Mb/s full duplex, 5 10 Mb/s half duplex, 6 negotiating. |
mac_speed | Negotiated link speed in Mb/s. |
mac_duplex | FD = full duplex, HD = half duplex. |
Normal operation shows 0 for buf_drop and tx_fail.
Example
status.py
from hmcls_udp import Board
def parse_status(line):
tokens = line.split()
fields = {"state": tokens[1]}
fields.update(zip(tokens[2::2], tokens[3::2]))
return fields
board = Board("192.168.1.11")
for line in board.query("STATUS"):
if line.startswith("STATUS"):
s = parse_status(line)
print(s["state"], s.get("stream_sps"), "rows/s, dropped:", s.get("buf_drop"))