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", },
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", },
struct dev_context *devc;
size_t i;
gchar *channel_name;
+ const char *command;
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);
}
+ /*
+ * 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);
+ }
+
return sdi;
}
static int dev_close(struct sr_dev_inst *sdi)
{
+ struct dev_context *devc;
struct sr_scpi_dev_inst *scpi;
+ const char *command;
+ devc = sdi->priv;
scpi = sdi->conn;
if (!scpi)
return SR_ERR_BUG;
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);
}