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:
parent
ce96b696b5
commit
5bf642dbf8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue