libgpib has an error_string which formats a numeric error code into a
human-readable description. Use that instead of printing the numeric
code, as it makes debugging easier.
if (ibsta & ERR)
{
- sr_err("Error while sending SCPI command: '%s': iberr = %d.",
- command, iberr);
+ sr_err("Error while sending SCPI command: '%s': iberr = %s.",
+ command, gpib_error_string(iberr));
return SR_ERR;
}
if (ibsta & ERR)
{
- sr_err("Error while reading SCPI response: iberr = %d.", iberr);
+ sr_err("Error while reading SCPI response: iberr = %s.",
+ gpib_error_string(iberr));
return SR_ERR;
}