Skip to content

Commit

Permalink
scpi-pps: Add support for R&S NGE100B series
Browse files Browse the repository at this point in the history
Tested with NGE103B power supply.

Signed-off-by: Marc Schink <[email protected]>
  • Loading branch information
zapb-0 authored and abraxa committed Aug 13, 2024
1 parent 6cb2273 commit 95042e1
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/60-libsigrok.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
82 changes: 82 additions & 0 deletions src/hardware/scpi-pps/profiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 95042e1

Please sign in to comment.