scpi-dmm: use different Agilent SCPI command for range and measurment
Don't use the "[SENS:]<mode>:RANGE..." request on Agilent protocol speaking devices. Use "CONF:<mode> [<range>]" instead. This was tested with all devices which reference this model. In theory there is the question whether previously configured ranges should be re-used when (exclusively) the MQ is switched. It's assumed that this is not useful, instead users or their applications should select the function first and optionally pick the range then. Re-use of e.g. 10k resistance range when switching to capacitance might be seen as confusing (and results in errors in the device). Use the combination of INIT and FETCH? to get measurements. The READ? request is more complex and might "undo" what INIT already initiated. This improves perception of the 34405A meter's operation.
This commit is contained in:
parent
bf03e06d57
commit
b74cc88d32
|
@ -54,12 +54,11 @@ static const struct scpi_command cmdset_agilent[] = {
|
||||||
{ DMM_CMD_QUERY_FUNC, "CONF?", },
|
{ DMM_CMD_QUERY_FUNC, "CONF?", },
|
||||||
{ DMM_CMD_START_ACQ, "INIT", },
|
{ DMM_CMD_START_ACQ, "INIT", },
|
||||||
{ DMM_CMD_STOP_ACQ, "ABORT", },
|
{ DMM_CMD_STOP_ACQ, "ABORT", },
|
||||||
{ DMM_CMD_QUERY_VALUE, "READ?", },
|
{ DMM_CMD_QUERY_VALUE, "FETCH?", },
|
||||||
{ DMM_CMD_QUERY_PREC, "CONF?", },
|
{ DMM_CMD_QUERY_PREC, "CONF?", },
|
||||||
{ DMM_CMD_QUERY_RANGE_AUTO, "%s:RANGE:AUTO?", },
|
{ DMM_CMD_QUERY_RANGE_AUTO, "%s:RANGE:AUTO?", },
|
||||||
{ DMM_CMD_QUERY_RANGE, "%s:RANGE?", },
|
{ DMM_CMD_QUERY_RANGE, "%s:RANGE?", },
|
||||||
{ DMM_CMD_SETUP_RANGE_AUTO, "%s:RANGE:AUTO ON", },
|
{ DMM_CMD_SETUP_RANGE, "CONF:%s %s", },
|
||||||
{ DMM_CMD_SETUP_RANGE, "%s:RANGE %s", },
|
|
||||||
ALL_ZERO,
|
ALL_ZERO,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -237,9 +237,8 @@ SR_PRIV int scpi_dmm_set_range_from_text(const struct sr_dev_inst *sdi,
|
||||||
|
|
||||||
is_auto = g_ascii_strcasecmp(range, "auto") == 0;
|
is_auto = g_ascii_strcasecmp(range, "auto") == 0;
|
||||||
scpi_dmm_cmd_delay(sdi->conn);
|
scpi_dmm_cmd_delay(sdi->conn);
|
||||||
ret = sr_scpi_cmd(sdi, devc->cmdset, 0, NULL,
|
ret = sr_scpi_cmd(sdi, devc->cmdset, 0, NULL, DMM_CMD_SETUP_RANGE,
|
||||||
is_auto ? DMM_CMD_SETUP_RANGE_AUTO : DMM_CMD_SETUP_RANGE,
|
item->scpi_func_setup, is_auto ? "AUTO" : range);
|
||||||
item->scpi_func_setup, is_auto ? "" : range);
|
|
||||||
if (ret != SR_OK)
|
if (ret != SR_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue