]> sigrok.org Git - libsigrok.git/commitdiff
scpi-pps: Add support for R&S NGE100B series
authorMarc Schink <redacted>
Fri, 26 Jan 2024 15:06:06 +0000 (16:06 +0100)
committerSoeren Apel <redacted>
Tue, 13 Aug 2024 09:32:49 +0000 (11:32 +0200)
Tested with NGE103B power supply.

Signed-off-by: Marc Schink <redacted>
contrib/60-libsigrok.rules
src/hardware/scpi-pps/profiles.c

index b6ac3ba045f35587287c4be08cce2d5987593ff3..29b935f70ca9b36417f7c2a15ec5363334dc53b0 100644 (file)
@@ -257,6 +257,9 @@ ATTRS{idVendor}=="0aad", ATTRS{idProduct}=="0119", ENV{ID_SIGROK}="1"
 # Rohde&Schwarz HMC series power supply (previously branded Hameg) VCP/USBTMC mode
 ATTRS{idVendor}=="0aad", ATTRS{idProduct}=="0135", ENV{ID_SIGROK}="1"
 
+# Rohde&Schwarz NGE100B series power supply VCP/USBTMC mode
+ATTRS{idVendor}=="0aad", ATTRS{idProduct}=="0197", ENV{ID_SIGROK}="1"
+
 # Sainsmart DDS120 / Rocktech BM102, renumerates as 1d50:608e "sigrok fx2lafw", Serial: Sainsmart DDS120
 ATTRS{idVendor}=="8102", ATTRS{idProduct}=="8102", ENV{ID_SIGROK}="1"
 
index 2b759e5d8187cccf66438238f44de31bf2092cfe..663b5b2d8311fb4517e4f4d386f1a6f1cfc015ba 100644 (file)
@@ -1291,6 +1291,64 @@ static const struct scpi_command rs_hmc8043_cmd[] = {
        ALL_ZERO
 };
 
+static const uint32_t rs_nge100b_devopts[] = {
+       SR_CONF_CONTINUOUS,
+       SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+       SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
+};
+
+static const uint32_t rs_nge100b_devopts_cg[] = {
+       SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET,
+       SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE | SR_CONF_GET,
+       SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET,
+       SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET,
+       SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE | SR_CONF_GET,
+       SR_CONF_OVER_CURRENT_PROTECTION_DELAY | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+       SR_CONF_VOLTAGE | SR_CONF_GET,
+       SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+       SR_CONF_CURRENT | SR_CONF_GET,
+       SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+       SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET,
+};
+
+static const struct channel_spec rs_nge100b_ch[] = {
+       { "1", { 0, 32.050, 0.001, 3, 4 }, { 0.001, 3, 0.001, 3, 4 }, { 0, 0, 0, 0, 4 }, FREQ_DC_ONLY, NO_OVP_LIMITS, NO_OCP_LIMITS, { 0.01, 10, 0.001, 3, 4}  },
+       { "2", { 0, 32.050, 0.001, 3, 4 }, { 0.001, 3, 0.001, 3, 4 }, { 0, 0, 0, 0, 4 }, FREQ_DC_ONLY, NO_OVP_LIMITS, NO_OCP_LIMITS, { 0.01, 10, 0.001, 3, 4} },
+       { "3", { 0, 32.050, 0.001, 3, 4 }, { 0.001, 3, 0.001, 3, 4 }, { 0, 0, 0, 0, 4 }, FREQ_DC_ONLY, NO_OVP_LIMITS, NO_OCP_LIMITS, { 0.01, 10, 0.001, 3, 4} },
+};
+
+static const struct channel_group_spec rs_nge100b_cg[] = {
+       { "1", CH_IDX(0), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
+       { "2", CH_IDX(1), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
+       { "3", CH_IDX(2), PPS_OVP | PPS_OCP, SR_MQFLAG_DC },
+};
+
+static const struct scpi_command rs_nge100b_cmd[] = {
+       { SCPI_CMD_SELECT_CHANNEL, "INST:NSEL %s" },
+       { SCPI_CMD_GET_MEAS_VOLTAGE, "MEAS:VOLT?" },
+       { SCPI_CMD_GET_MEAS_CURRENT, "MEAS:CURR?" },
+       { SCPI_CMD_GET_VOLTAGE_TARGET, "VOLT?" },
+       { SCPI_CMD_SET_VOLTAGE_TARGET, "VOLT %.6f" },
+       { SCPI_CMD_GET_CURRENT_LIMIT, "CURR?" },
+       { SCPI_CMD_SET_CURRENT_LIMIT, "CURR %.6f" },
+       { SCPI_CMD_GET_OUTPUT_ENABLED, "OUTP?" },
+       { SCPI_CMD_SET_OUTPUT_ENABLE, "OUTP ON" },
+       { SCPI_CMD_SET_OUTPUT_DISABLE, "OUTP OFF" },
+       { SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ACTIVE, "VOLT:PROT:TRIP?" },
+       { SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_THRESHOLD, "VOLT:PROT:LEV?" },
+       { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD, "VOLT:PROT:LEV %.6f" },
+       { SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ENABLED, "VOLT:PROT:STAT?" },
+       { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLE, "VOLT:PROT:STAT ON" },
+       { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_DISABLE, "VOLT:PROT:STAT OFF" },
+       { SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ACTIVE, "FUSE:TRIP?" },
+       { SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ENABLED, "FUSE:STAT?" },
+       { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE, "FUSE:STAT ON" },
+       { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE, "FUSE:STAT OFF" },
+       { SCPI_CMD_GET_OVER_CURRENT_PROTECTION_DELAY, "FUSE:DEL?" },
+       { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DELAY, "FUSE:DEL %.03f" },
+       ALL_ZERO
+};
+
 static const uint32_t rs_hmp4040_devopts[] = {
        SR_CONF_CONTINUOUS,
        SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
@@ -1766,6 +1824,30 @@ SR_PRIV const struct scpi_pps pps_profiles[] = {
                .update_status = NULL,
        },
 
+       /* Rohde & Schwarz NGE102B */
+       { "Rohde&Schwarz", "NGE102B", SCPI_DIALECT_UNKNOWN, 0,
+               ARRAY_AND_SIZE(rs_nge100b_devopts),
+               ARRAY_AND_SIZE(rs_nge100b_devopts_cg),
+               rs_nge100b_ch, 2,
+               rs_nge100b_cg, 2,
+               rs_nge100b_cmd,
+               .probe_channels = NULL,
+               .init_acquisition = NULL,
+               .update_status = NULL,
+       },
+
+       /* Rohde & Schwarz NGE103B */
+       { "Rohde&Schwarz", "NGE103B", SCPI_DIALECT_UNKNOWN, 0,
+               ARRAY_AND_SIZE(rs_nge100b_devopts),
+               ARRAY_AND_SIZE(rs_nge100b_devopts_cg),
+               ARRAY_AND_SIZE(rs_nge100b_ch),
+               ARRAY_AND_SIZE(rs_nge100b_cg),
+               rs_nge100b_cmd,
+               .probe_channels = NULL,
+               .init_acquisition = NULL,
+               .update_status = NULL,
+       },
+
        /* Hameg / Rohde&Schwarz HMP4000 series */
        /* TODO Match on regex, pass scpi_pps item to .probe_channels(). */
        { "HAMEG", "HMP4030", SCPI_DIALECT_HMP, 0,