From: Gerhard Sittig Date: Tue, 25 Aug 2020 18:47:26 +0000 (+0200) Subject: scpi-pps: use remote and local modes for HMP4000 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f403cb9de9795bbbb9e295a0d3ca78c8dce5ff1a;p=libsigrok.git scpi-pps: use remote and local modes for HMP4000 Stop using the unusal "mixed" mode (local interface available during remote operation) for HMP4000, applications may not be prepared for this use case. Use traditional "remote" and "local" modes instead. This change also ends remote mode after the application is done using the device. --- diff --git a/src/hardware/scpi-pps/profiles.c b/src/hardware/scpi-pps/profiles.c index 3787ec67..71a8e88d 100644 --- a/src/hardware/scpi-pps/profiles.c +++ b/src/hardware/scpi-pps/profiles.c @@ -1083,6 +1083,8 @@ static const struct channel_group_spec rs_hmp4040_cg[] = { * SYST:BEEP:IMM */ static const struct scpi_command rs_hmp4040_cmd[] = { + { SCPI_CMD_REMOTE, "SYST:REM" }, + { SCPI_CMD_LOCAL, "SYST:LOC" }, { SCPI_CMD_SELECT_CHANNEL, "INST:NSEL %s" }, { SCPI_CMD_GET_MEAS_VOLTAGE, "MEAS:VOLT?" }, { SCPI_CMD_GET_MEAS_CURRENT, "MEAS:CURR?" }, @@ -1101,24 +1103,6 @@ static const struct scpi_command rs_hmp4040_cmd[] = { ALL_ZERO }; -static int rs_hmp_init_acquisition(const struct sr_dev_inst *sdi) -{ - struct sr_scpi_dev_inst *scpi; - int ret; - - scpi = sdi->conn; - - /* - * Sets the system to remote state. The front panel and remote - * control are possible simultaneously (mixed mode). - */ - ret = sr_scpi_send(scpi, "SYST:MIX"); - if (ret != SR_OK) - return ret; - - return SR_OK; -} - SR_PRIV const struct scpi_pps pps_profiles[] = { /* Agilent N5763A */ { "Agilent", "N5763A", SCPI_DIALECT_UNKNOWN, 0, @@ -1441,7 +1425,7 @@ SR_PRIV const struct scpi_pps pps_profiles[] = { rs_hmp4040_cg, 3, rs_hmp4040_cmd, .probe_channels = NULL, - .init_acquisition = rs_hmp_init_acquisition, + .init_acquisition = NULL, .update_status = NULL, }, { "HAMEG", "HMP4040", SCPI_DIALECT_HMP, 0, @@ -1451,7 +1435,7 @@ SR_PRIV const struct scpi_pps pps_profiles[] = { ARRAY_AND_SIZE(rs_hmp4040_cg), rs_hmp4040_cmd, .probe_channels = NULL, - .init_acquisition = rs_hmp_init_acquisition, + .init_acquisition = NULL, .update_status = NULL, }, { "ROHDE&SCHWARZ", "HMP4030", SCPI_DIALECT_HMP, 0, @@ -1461,7 +1445,7 @@ SR_PRIV const struct scpi_pps pps_profiles[] = { rs_hmp4040_cg, 3, rs_hmp4040_cmd, .probe_channels = NULL, - .init_acquisition = rs_hmp_init_acquisition, + .init_acquisition = NULL, .update_status = NULL, }, { "ROHDE&SCHWARZ", "HMP4040", SCPI_DIALECT_HMP, 0, @@ -1471,7 +1455,7 @@ SR_PRIV const struct scpi_pps pps_profiles[] = { ARRAY_AND_SIZE(rs_hmp4040_cg), rs_hmp4040_cmd, .probe_channels = NULL, - .init_acquisition = rs_hmp_init_acquisition, + .init_acquisition = NULL, .update_status = NULL, }, };