return No error for SYST:ERR:ALL? if no errors present, not just newline.

master 0.1.2
Ondřej Hruška 9 years ago
parent 808637a779
commit 01a7c9d556
  1. 3
      example/example.c
  2. 18
      source/scpi_builtins.c

@ -32,6 +32,9 @@ int main(void)
// test chardata
send_cmd("CHARD FOOBAR123_MOO_abcdef_HELLO, 12\n");
send_cmd("SYST:ERR:ALL?\n");
}

@ -158,14 +158,18 @@ static void builtin_SYST_ERR_ALLq(const SCPI_argval_t *args)
{
(void)args;
int cnt = 0;
while (scpi_error_count()) {
scpi_read_error(sbuf);
if (cnt++ > 0) scpi_send_string_raw(",");
scpi_send_string_raw(sbuf);
if (scpi_error_count()) {
int cnt = 0;
while (scpi_error_count()) {
scpi_read_error(sbuf);
if (cnt++ > 0) scpi_send_string_raw(",");
scpi_send_string_raw(sbuf);
scpi_send_string_raw(scpi_eol);
}
} else {
scpi_read_error(sbuf); // O,"No error"
scpi_send_string(sbuf);
}
scpi_send_string_raw(scpi_eol);
}

Loading…
Cancel
Save