struct pps_channel *pch;
double d;
int ret;
- const char *s;
if (!sdi)
return SR_ERR_ARG;
switch (key) {
/* No channel group: global options. */
case SR_CONF_OUTPUT_ENABLED:
- s = g_variant_get_boolean(data) ? "ON" : "OFF";
- ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_ENABLED, s);
+ if (g_variant_get_boolean(data))
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_ENABLE);
+ else
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_DISABLE);
break;
case SR_CONF_OUTPUT_VOLTAGE_MAX:
d = g_variant_get_double(data);
ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_MAX, d);
break;
case SR_CONF_OVER_TEMPERATURE_PROTECTION:
- s = g_variant_get_boolean(data) ? "ON" : "OFF";
- ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION, s);
+ if (g_variant_get_boolean(data))
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_ENABLE);
+ else
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_DISABLE);
break;
default:
ret = SR_ERR_NA;
pch = ch->priv;
switch (key) {
case SR_CONF_OUTPUT_ENABLED:
- s = g_variant_get_boolean(data) ? "ON" : "OFF";
- ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_ENABLED, pch->hwname, s);
+ if (g_variant_get_boolean(data))
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_ENABLE, pch->hwname);
+ else
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_DISABLE, pch->hwname);
break;
case SR_CONF_OUTPUT_VOLTAGE_MAX:
d = g_variant_get_double(data);
ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_MAX, pch->hwname, d);
break;
case SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED:
- s = g_variant_get_boolean(data) ? "ON" : "OFF";
- ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLED,
- pch->hwname, s);
+ if (g_variant_get_boolean(data))
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLE,
+ pch->hwname);
+ else
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_DISABLE,
+ pch->hwname);
break;
case SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD:
d = g_variant_get_double(data);
pch->hwname, d);
break;
case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED:
- s = g_variant_get_boolean(data) ? "ON" : "OFF";
- ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLED,
- pch->hwname, s);
+ if (g_variant_get_boolean(data))
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE,
+ pch->hwname);
+ else
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE,
+ pch->hwname);
break;
case SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD:
d = g_variant_get_double(data);
{ SCPI_CMD_GET_CURRENT_MAX, ":SOUR%s:CURR?" },
{ SCPI_CMD_SET_CURRENT_MAX, ":SOUR%s:CURR %.6f" },
{ SCPI_CMD_GET_OUTPUT_ENABLED, ":OUTP? CH%s" },
- { SCPI_CMD_SET_OUTPUT_ENABLED, ":OUTP CH%s,%s" },
+ { SCPI_CMD_SET_OUTPUT_ENABLE, ":OUTP CH%s,ON" },
+ { SCPI_CMD_SET_OUTPUT_DISABLE, ":OUTP CH%s,OFF" },
{ SCPI_CMD_GET_OUTPUT_REGULATION, ":OUTP:MODE? CH%s" },
{ SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION, ":SYST:OTP?" },
- { SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION, ":SYST:OTP %s" },
+ { SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_ENABLE, ":SYST:OTP ON" },
+ { SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_DISABLE, ":SYST:OTP OFF" },
{ SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ENABLED, ":OUTP:OVP? CH%s" },
- { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLED, ":OUTP:OVP CH%s,%s" },
+ { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLE, ":OUTP:OVP CH%s,ON" },
+ { SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_DISABLE, ":OUTP:OVP CH%s,OFF" },
{ SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ACTIVE, ":OUTP:OVP:QUES? CH%s" },
{ SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_THRESHOLD, ":OUTP:OVP:VAL? CH%s" },
{ SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD, ":OUTP:OVP:VAL CH%s,%.6f" },
{ SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ENABLED, ":OUTP:OCP? CH%s" },
- { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLED, ":OUTP:OCP CH%s,%s" },
+ { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE, ":OUTP:OCP CH%s,ON" },
+ { SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE, ":OUTP:OCP CH%s,OFF" },
{ SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ACTIVE, ":OUTP:OCP:QUES? CH%s" },
{ SCPI_CMD_GET_OVER_CURRENT_PROTECTION_THRESHOLD, ":OUTP:OCP:VAL? CH%s" },
{ SCPI_CMD_SET_OVER_CURRENT_PROTECTION_THRESHOLD, ":OUTP:OCP:VAL CH%s,%.6f" },
struct scpi_command hp_6632b_cmd[] = {
{ SCPI_CMD_GET_OUTPUT_ENABLED, "OUTP:STAT?" },
- { SCPI_CMD_SET_OUTPUT_ENABLED, "OUTP:STAT %s" },
+ { SCPI_CMD_SET_OUTPUT_ENABLE, "OUTP:STAT ON" },
+ { SCPI_CMD_SET_OUTPUT_DISABLE, "OUTP:STAT OFF" },
{ SCPI_CMD_GET_MEAS_VOLTAGE, ":MEAS:VOLT?" },
{ SCPI_CMD_GET_MEAS_CURRENT, ":MEAS:CURR?" },
{ SCPI_CMD_GET_VOLTAGE_MAX, ":SOUR:VOLT?" },
SCPI_CMD_GET_CURRENT_MAX,
SCPI_CMD_SET_CURRENT_MAX,
SCPI_CMD_GET_OUTPUT_ENABLED,
- SCPI_CMD_SET_OUTPUT_ENABLED,
+ SCPI_CMD_SET_OUTPUT_ENABLE,
+ SCPI_CMD_SET_OUTPUT_DISABLE,
SCPI_CMD_GET_OUTPUT_REGULATION,
SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION,
- SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION,
+ SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_ENABLE,
+ SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_DISABLE,
SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ENABLED,
- SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLED,
+ SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLE,
+ SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_DISABLE,
SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ACTIVE,
SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_THRESHOLD,
SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD,
SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ENABLED,
- SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLED,
+ SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE,
+ SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE,
SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ACTIVE,
SCPI_CMD_GET_OVER_CURRENT_PROTECTION_THRESHOLD,
SCPI_CMD_SET_OVER_CURRENT_PROTECTION_THRESHOLD,