scpi-dmm: avoid get/set range calls for some of the Agilent DMM functions

While queries for the range are supported for voltage, current,
resistence, capacitance, the same queries in temperature, frequency,
diode, continuity modes not only fail but even lose the USB connection
to the device. This was consistently observed with 34405A and 34465A.

Suppress get and set range requests for the known problematic modes of
the Agilent protocol speaking meters.
This commit is contained in:
Gerhard Sittig 2021-05-21 18:37:05 +02:00
父節點 ce96b696b5
當前提交 5bf642dbf8
共有 3 個檔案被更改,包括 9 行新增4 行删除

查看文件

@ -133,11 +133,11 @@ static const struct mqopt_item mqopts_agilent_34405a[] = {
{ SR_MQ_CURRENT, SR_MQFLAG_AC, "CURR:AC", "CURR:AC ", NO_DFLT_PREC, FLAGS_NONE, },
{ SR_MQ_RESISTANCE, 0, "RES", "RES ", NO_DFLT_PREC, FLAGS_NONE, },
{ SR_MQ_RESISTANCE, SR_MQFLAG_FOUR_WIRE, "FRES", "FRES ", NO_DFLT_PREC, FLAGS_NONE, },
{ SR_MQ_CONTINUITY, 0, "CONT", "CONT", -1, FLAGS_NONE, },
{ SR_MQ_CONTINUITY, 0, "CONT", "CONT", -1, FLAG_NO_RANGE, },
{ SR_MQ_CAPACITANCE, 0, "CAP", "CAP ", NO_DFLT_PREC, FLAGS_NONE, },
{ SR_MQ_VOLTAGE, SR_MQFLAG_DC | SR_MQFLAG_DIODE, "DIOD", "DIOD", -4, FLAGS_NONE, },
{ SR_MQ_TEMPERATURE, 0, "TEMP", "TEMP ", NO_DFLT_PREC, FLAGS_NONE, },
{ SR_MQ_FREQUENCY, 0, "FREQ", "FREQ ", NO_DFLT_PREC, FLAGS_NONE, },
{ SR_MQ_VOLTAGE, SR_MQFLAG_DC | SR_MQFLAG_DIODE, "DIOD", "DIOD", -4, FLAG_NO_RANGE, },
{ SR_MQ_TEMPERATURE, 0, "TEMP", "TEMP ", NO_DFLT_PREC, FLAG_NO_RANGE, },
{ SR_MQ_FREQUENCY, 0, "FREQ", "FREQ ", NO_DFLT_PREC, FLAG_NO_RANGE, },
};
static const struct mqopt_item mqopts_agilent_34401a[] = {

查看文件

@ -171,6 +171,8 @@ SR_PRIV const char *scpi_dmm_get_range_text(const struct sr_dev_inst *sdi)
return NULL;
if (!mqitem || !mqitem->scpi_func_setup)
return NULL;
if (mqitem->drv_flags & FLAG_NO_RANGE)
return NULL;
scpi_dmm_cmd_delay(sdi->conn);
ret = sr_scpi_cmd(sdi, devc->cmdset, 0, NULL,
@ -230,6 +232,8 @@ SR_PRIV int scpi_dmm_set_range_from_text(const struct sr_dev_inst *sdi,
return ret;
if (!item || !item->scpi_func_setup)
return SR_ERR_ARG;
if (item->drv_flags & FLAG_NO_RANGE)
return SR_ERR_NA;
is_auto = g_ascii_strcasecmp(range, "auto") == 0;
scpi_dmm_cmd_delay(sdi->conn);

查看文件

@ -57,6 +57,7 @@ struct mqopt_item {
};
#define NO_DFLT_PREC -99
#define FLAGS_NONE 0
#define FLAG_NO_RANGE (1 << 0)
struct scpi_dmm_model {
const char *vendor;