]> sigrok.org Git - libsigrok.git/commitdiff
scpi-pps: use remote and local modes for HMP4000
authorGerhard Sittig <redacted>
Tue, 25 Aug 2020 18:47:26 +0000 (20:47 +0200)
committerGerhard Sittig <redacted>
Tue, 25 Aug 2020 19:06:01 +0000 (21:06 +0200)
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.

src/hardware/scpi-pps/profiles.c

index 3787ec674cf65f51df06772bbecc964ca7d001ee..71a8e88d07f55a01d48a4fa695a874270c076bf2 100644 (file)
@@ -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,
        },
 };