summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
25879a3)
Add new command DMM_CMD_SETUP_LOCAL for setting device back
to "local" mode. If device implmements this command, it is
sent when driver is closed and after device "scan".
Define DMM_CMD_SETUP_LOCAL for GWInstek meters, so they get
returned to local mode automatically after use.
static const struct scpi_command cmdset_gwinstek[] = {
{ DMM_CMD_SETUP_REMOTE, "SYST:REM", },
static const struct scpi_command cmdset_gwinstek[] = {
{ DMM_CMD_SETUP_REMOTE, "SYST:REM", },
+ { DMM_CMD_SETUP_LOCAL, "SYST:LOC", },
{ DMM_CMD_SETUP_FUNC, "CONF:%s", },
{ DMM_CMD_QUERY_FUNC, "CONF:STAT:FUNC?", },
{ DMM_CMD_START_ACQ, "*CLS;SYST:REM", },
{ DMM_CMD_SETUP_FUNC, "CONF:%s", },
{ DMM_CMD_QUERY_FUNC, "CONF:STAT:FUNC?", },
{ DMM_CMD_START_ACQ, "*CLS;SYST:REM", },
static const struct scpi_command cmdset_gwinstek_906x[] = {
{ DMM_CMD_SETUP_REMOTE, "SYST:REM", },
static const struct scpi_command cmdset_gwinstek_906x[] = {
{ DMM_CMD_SETUP_REMOTE, "SYST:REM", },
+ { DMM_CMD_SETUP_LOCAL, "SYST:LOC", },
{ DMM_CMD_SETUP_FUNC, "CONF:%s", },
{ DMM_CMD_QUERY_FUNC, "CONF?", },
{ DMM_CMD_START_ACQ, "*CLS;SYST:REM", },
{ DMM_CMD_SETUP_FUNC, "CONF:%s", },
{ DMM_CMD_QUERY_FUNC, "CONF?", },
{ DMM_CMD_START_ACQ, "*CLS;SYST:REM", },
struct dev_context *devc;
size_t i;
gchar *channel_name;
struct dev_context *devc;
size_t i;
gchar *channel_name;
scpi_dmm_cmd_delay(scpi);
ret = sr_scpi_get_hw_id(scpi, &hw_info);
scpi_dmm_cmd_delay(scpi);
ret = sr_scpi_get_hw_id(scpi, &hw_info);
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, channel_name);
}
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, channel_name);
}
+ /*
+ * If device has DMM_CMD_SETUP_LOCAL command, send it now. To avoid
+ * leaving device in remote mode (if only a "scan" is run).
+ */
+ command = sr_scpi_cmd_get(devc->cmdset, DMM_CMD_SETUP_LOCAL);
+ if (command && *command) {
+ scpi_dmm_cmd_delay(scpi);
+ sr_scpi_send(scpi, command);
+ }
+
static int dev_close(struct sr_dev_inst *sdi)
{
static int dev_close(struct sr_dev_inst *sdi)
{
+ struct dev_context *devc;
struct sr_scpi_dev_inst *scpi;
struct sr_scpi_dev_inst *scpi;
scpi = sdi->conn;
if (!scpi)
return SR_ERR_BUG;
scpi = sdi->conn;
if (!scpi)
return SR_ERR_BUG;
if (sdi->status <= SR_ST_INACTIVE)
return SR_OK;
if (sdi->status <= SR_ST_INACTIVE)
return SR_OK;
+ /*
+ * If device has DMM_CMD_SETUP_LOCAL command, send it now
+ * to avoid leaving device in remote mode.
+ */
+ command = sr_scpi_cmd_get(devc->cmdset, DMM_CMD_SETUP_LOCAL);
+ if (command && *command) {
+ scpi_dmm_cmd_delay(scpi);
+ sr_scpi_send(scpi, command);
+ }
+
return sr_scpi_close(scpi);
}
return sr_scpi_close(scpi);
}
DMM_CMD_STOP_ACQ,
DMM_CMD_QUERY_VALUE,
DMM_CMD_QUERY_PREC,
DMM_CMD_STOP_ACQ,
DMM_CMD_QUERY_VALUE,
DMM_CMD_QUERY_PREC,