char *channel_group_name;
int cmd, ret;
const char *s;
- int oper_cond;
+ int reg;
if (!sdi)
return SR_ERR_ARG;
cmd = SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ENABLED;
break;
case SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE:
- gvtype = G_VARIANT_TYPE_BOOLEAN;
+ if (devc->device->dialect == SCPI_DIALECT_HP_66XXB)
+ gvtype = G_VARIANT_TYPE_STRING;
+ else
+ gvtype = G_VARIANT_TYPE_BOOLEAN;
cmd = SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ACTIVE;
break;
case SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD:
cmd = SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ENABLED;
break;
case SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE:
- gvtype = G_VARIANT_TYPE_BOOLEAN;
+ if (devc->device->dialect == SCPI_DIALECT_HP_66XXB)
+ gvtype = G_VARIANT_TYPE_STRING;
+ else
+ gvtype = G_VARIANT_TYPE_BOOLEAN;
cmd = SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ACTIVE;
break;
case SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD:
gvtype = G_VARIANT_TYPE_BOOLEAN;
cmd = SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION;
break;
+ case SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE:
+ if (devc->device->dialect == SCPI_DIALECT_HP_66XXB)
+ gvtype = G_VARIANT_TYPE_STRING;
+ else
+ gvtype = G_VARIANT_TYPE_BOOLEAN;
+ cmd = SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION_ACTIVE;
+ break;
case SR_CONF_REGULATION:
gvtype = G_VARIANT_TYPE_STRING;
cmd = SCPI_CMD_GET_OUTPUT_REGULATION;
if (devc->device->dialect == SCPI_DIALECT_HP_66XXB) {
/* Evaluate Operational Status Register from a HP 66xxB. */
s = g_variant_get_string(*data, NULL);
- sr_atoi(s, &oper_cond);
+ sr_atoi(s, ®);
g_variant_unref(*data);
- if (oper_cond & (1 << 8))
+ if (reg & (1 << 8))
*data = g_variant_new_string("CV");
- else if (oper_cond & (1 << 10))
+ else if (reg & (1 << 10))
*data = g_variant_new_string("CC");
- else if (oper_cond & (1 << 11))
+ else if (reg & (1 << 11))
*data = g_variant_new_string("CC-");
else
*data = g_variant_new_string("UR");
}
}
+ if (cmd == SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ACTIVE) {
+ if (devc->device->dialect == SCPI_DIALECT_HP_66XXB) {
+ /* Evaluate Questionable Status Register bit 0 from a HP 66xxB. */
+ s = g_variant_get_string(*data, NULL);
+ sr_atoi(s, ®);
+ g_variant_unref(*data);
+ *data = g_variant_new_boolean(reg & (1 << 0));
+ }
+ }
+
+ if (cmd == SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ACTIVE) {
+ if (devc->device->dialect == SCPI_DIALECT_HP_66XXB) {
+ /* Evaluate Questionable Status Register bit 1 from a HP 66xxB. */
+ s = g_variant_get_string(*data, NULL);
+ sr_atoi(s, ®);
+ g_variant_unref(*data);
+ *data = g_variant_new_boolean(reg & (1 << 1));
+ }
+ }
+
+ if (cmd == SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION_ACTIVE) {
+ if (devc->device->dialect == SCPI_DIALECT_HP_66XXB) {
+ /* Evaluate Questionable Status Register bit 4 from a HP 66xxB. */
+ s = g_variant_get_string(*data, NULL);
+ sr_atoi(s, ®);
+ g_variant_unref(*data);
+ *data = g_variant_new_boolean(reg & (1 << 4));
+ }
+ }
+
return ret;
}
SR_CONF_CURRENT | SR_CONF_GET,
SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE | SR_CONF_GET,
SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE | SR_CONF_GET,
+ SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE | SR_CONF_GET,
SR_CONF_REGULATION | SR_CONF_GET,
};
{ SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ENABLED, ":CURR:PROT:STAT?" },
{ SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE, ":CURR:PROT:STAT 1" },
{ SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE, ":CURR:PROT:STAT 0" },
+ { SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ACTIVE, "STAT:QUES:COND?" },
+ { SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ACTIVE, "STAT:QUES:COND?" },
{ SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_THRESHOLD, ":VOLT:PROT?" },
{ SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD, ":VOLT:PROT %.6f" },
+ { SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION_ACTIVE, "STAT:QUES:COND?" },
{ SCPI_CMD_GET_OUTPUT_REGULATION, "STAT:OPER:COND?" },
ALL_ZERO
};