/**
* Output voltage.
* @arg type: double
- * @arg get: get output voltage
+ * @arg get: get measured output voltage
*/
SR_CONF_OUTPUT_VOLTAGE,
/**
- * Maximum output voltage.
+ * Maximum output voltage target.
* @arg type: double
- * @arg get: get maximum output voltage limit
- * @arg set: change output voltage limit
+ * @arg get: get output voltage target
+ * @arg set: change output voltage target
*/
- SR_CONF_OUTPUT_VOLTAGE_MAX,
+ SR_CONF_OUTPUT_VOLTAGE_TARGET,
/**
* Output current.
* @arg type: double
- * @arg get: get output current
+ * @arg get: get measured output current
*/
SR_CONF_OUTPUT_CURRENT,
/**
- * Maximum output current.
+ * Output current limit.
* @arg type: double
- * @arg get: get maximum output voltage limit
- * @arg set: change output voltage limit
+ * @arg get: get output current limit
+ * @arg set: change output current limit
*/
- SR_CONF_OUTPUT_CURRENT_MAX,
+ SR_CONF_OUTPUT_CURRENT_LIMIT,
/**
* Enabling/disabling output.
static const uint32_t devopts_cg[] = {
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
- SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
- SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
case SR_CONF_OUTPUT_VOLTAGE:
*data = g_variant_new_double(devc->config[channel].output_voltage_last);
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
*data = g_variant_new_double(devc->config[channel].output_voltage_max);
break;
case SR_CONF_OUTPUT_CURRENT:
*data = g_variant_new_double(devc->config[channel].output_current_last);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
*data = g_variant_new_double(devc->config[channel].output_current_max);
break;
case SR_CONF_OUTPUT_ENABLED:
channel = ch->index;
switch (key) {
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
dval = g_variant_get_double(data);
if (dval < 0 || dval > devc->model->channels[channel].voltage[1])
ret = SR_ERR_ARG;
devc->config[channel].output_voltage_max = dval;
devc->config_dirty = TRUE;
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
dval = g_variant_get_double(data);
if (dval < 0 || dval > devc->model->channels[channel].current[1])
ret = SR_ERR_ARG;
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, step. */
for (i = 0; i < 3; i++) {
}
*data = g_variant_builder_end(&gvb);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, step. */
for (i = 0; i < 3; i++) {
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
/* Device configuration */
+ SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
+ SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
- SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
- SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
- SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
/* Note: All models have one power supply output only. */
case SR_CONF_LIMIT_MSEC:
*data = g_variant_new_uint64(devc->limit_msec);
break;
+ case SR_CONF_OUTPUT_VOLTAGE:
+ *data = g_variant_new_double(devc->voltage);
+ break;
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
+ *data = g_variant_new_double(devc->voltage_max);
+ break;
case SR_CONF_OUTPUT_CURRENT:
*data = g_variant_new_double(devc->current);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
*data = g_variant_new_double(devc->current_max);
break;
case SR_CONF_OUTPUT_ENABLED:
*data = g_variant_new_boolean(devc->output_enabled);
break;
- case SR_CONF_OUTPUT_VOLTAGE:
- *data = g_variant_new_double(devc->voltage);
- break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
- *data = g_variant_new_double(devc->voltage_max);
- break;
default:
return SR_ERR_NA;
}
return SR_ERR_ARG;
devc->limit_samples = g_variant_get_uint64(data);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
+ dval = g_variant_get_double(data);
+ if (dval < devc->model->voltage[0] || dval > devc->voltage_max_device)
+ return SR_ERR_ARG;
+
+ if ((hcs_send_cmd(sdi->conn, "VOLT%03.0f\r",
+ (dval / devc->model->voltage[2])) < 0) ||
+ (hcs_read_reply(sdi->conn, 1, devc->buf, sizeof(devc->buf)) < 0))
+ return SR_ERR;
+ devc->voltage_max = dval;
+ break;
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
dval = g_variant_get_double(data);
if (dval < devc->model->current[0] || dval > devc->current_max_device)
return SR_ERR_ARG;
return SR_ERR;
devc->output_enabled = bval;
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
- dval = g_variant_get_double(data);
- if (dval < devc->model->voltage[0] || dval > devc->voltage_max_device)
- return SR_ERR_ARG;
-
- if ((hcs_send_cmd(sdi->conn, "VOLT%03.0f\r",
- (dval / devc->model->voltage[2])) < 0) ||
- (hcs_read_reply(sdi->conn, 1, devc->buf, sizeof(devc->buf)) < 0))
- return SR_ERR;
- devc->voltage_max = dval;
- break;
default:
return SR_ERR_NA;
}
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, step. */
for (idx = 0; idx < 3; idx++) {
if (idx == 1)
- dval = devc->current_max_device;
+ dval = devc->voltage_max_device;
else
- dval = devc->model->current[idx];
+ dval = devc->model->voltage[idx];
gvar = g_variant_new_double(dval);
g_variant_builder_add_value(&gvb, gvar);
}
*data = g_variant_builder_end(&gvb);
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, step. */
for (idx = 0; idx < 3; idx++) {
if (idx == 1)
- dval = devc->voltage_max_device;
+ dval = devc->current_max_device;
else
- dval = devc->model->voltage[idx];
+ dval = devc->model->current[idx];
gvar = g_variant_new_double(dval);
g_variant_builder_add_value(&gvb, gvar);
}
/** Hardware capabilities channel 1, 2. */
static const uint32_t devopts_ch12[] = {
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
- SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
- SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
case SR_CONF_OUTPUT_VOLTAGE:
*data = g_variant_new_double(devc->channel_status[ch_idx].output_voltage_last);
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
*data = g_variant_new_double(devc->channel_status[ch_idx].output_voltage_max);
break;
case SR_CONF_OUTPUT_CURRENT:
*data = g_variant_new_double(devc->channel_status[ch_idx].output_current_last);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
*data = g_variant_new_double(devc->channel_status[ch_idx].output_current_max);
break;
case SR_CONF_OUTPUT_ENABLED:
ch_idx = ch->index;
switch (key) {
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
dval = g_variant_get_double(data);
if (dval < 0 || dval > devc->model->channels[ch_idx].voltage[1])
return SR_ERR_ARG;
else
return lps_cmd_ok(sdi->conn, "VSET%d %05.3f", ch_idx+1, dval);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
dval = g_variant_get_double(data);
if (dval < 0 || dval > devc->model->channels[ch_idx].current[1])
return SR_ERR_ARG;
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t));
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, step. */
for (i = 0; i < 3; i++) {
}
*data = g_variant_builder_end(&gvb);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, step. */
for (i = 0; i < 3; i++) {
gvtype = G_VARIANT_TYPE_DOUBLE;
cmd = SCPI_CMD_GET_MEAS_VOLTAGE;
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
gvtype = G_VARIANT_TYPE_DOUBLE;
- cmd = SCPI_CMD_GET_VOLTAGE_MAX;
+ cmd = SCPI_CMD_GET_VOLTAGE_TARGET;
break;
case SR_CONF_OUTPUT_CURRENT:
gvtype = G_VARIANT_TYPE_DOUBLE;
cmd = SCPI_CMD_GET_MEAS_CURRENT;
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
gvtype = G_VARIANT_TYPE_DOUBLE;
- cmd = SCPI_CMD_GET_CURRENT_MAX;
+ cmd = SCPI_CMD_GET_CURRENT_LIMIT;
break;
case SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED:
gvtype = G_VARIANT_TYPE_BOOLEAN;
else
ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_DISABLE);
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
d = g_variant_get_double(data);
- ret = scpi_cmd(sdi, SCPI_CMD_SET_VOLTAGE_MAX, d);
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_VOLTAGE_TARGET, d);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
d = g_variant_get_double(data);
- ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_MAX, d);
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_LIMIT, d);
break;
case SR_CONF_OVER_TEMPERATURE_PROTECTION:
if (g_variant_get_boolean(data))
else
ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_DISABLE, pch->hwname);
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
d = g_variant_get_double(data);
- ret = scpi_cmd(sdi, SCPI_CMD_SET_VOLTAGE_MAX, pch->hwname, d);
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_VOLTAGE_TARGET, pch->hwname, d);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
d = g_variant_get_double(data);
- ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_MAX, pch->hwname, d);
+ ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_LIMIT, pch->hwname, d);
break;
case SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED:
if (g_variant_get_boolean(data))
devc->device->devopts_cg, devc->device->num_devopts_cg,
sizeof(uint32_t));
break;
- case SR_CONF_OUTPUT_VOLTAGE_MAX:
+ case SR_CONF_OUTPUT_VOLTAGE_TARGET:
ch_spec = &(devc->device->channels[ch->index]);
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, write resolution. */
}
*data = g_variant_builder_end(&gvb);
break;
- case SR_CONF_OUTPUT_CURRENT_MAX:
+ case SR_CONF_OUTPUT_CURRENT_LIMIT:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
/* Min, max, step. */
for (i = 0; i < 3; i++) {
SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE | SR_CONF_GET,
SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
- SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
- SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
{ SCPI_CMD_GET_MEAS_VOLTAGE, ":MEAS:VOLT? CH%s" },
{ SCPI_CMD_GET_MEAS_CURRENT, ":MEAS:CURR? CH%s" },
{ SCPI_CMD_GET_MEAS_POWER, ":MEAS:POWE? CH%s" },
- { SCPI_CMD_GET_VOLTAGE_MAX, ":SOUR%s:VOLT?" },
- { SCPI_CMD_SET_VOLTAGE_MAX, ":SOUR%s:VOLT %.6f" },
- { SCPI_CMD_GET_CURRENT_MAX, ":SOUR%s:CURR?" },
- { SCPI_CMD_SET_CURRENT_MAX, ":SOUR%s:CURR %.6f" },
+ { SCPI_CMD_GET_VOLTAGE_TARGET, ":SOUR%s:VOLT?" },
+ { SCPI_CMD_SET_VOLTAGE_TARGET, ":SOUR%s:VOLT %.6f" },
+ { SCPI_CMD_GET_CURRENT_LIMIT, ":SOUR%s:CURR?" },
+ { SCPI_CMD_SET_CURRENT_LIMIT, ":SOUR%s:CURR %.6f" },
{ SCPI_CMD_GET_OUTPUT_ENABLED, ":OUTP? CH%s" },
{ SCPI_CMD_SET_OUTPUT_ENABLE, ":OUTP CH%s,ON" },
{ SCPI_CMD_SET_OUTPUT_DISABLE, ":OUTP CH%s,OFF" },
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
- SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
- SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+ SR_CONF_OUTPUT_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
struct channel_spec hp_6632b_ch[] = {
{ 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_SET_VOLTAGE_MAX, ":SOUR:VOLT %.6f" },
- { SCPI_CMD_GET_CURRENT_MAX, ":SOUR:CURR?" },
- { SCPI_CMD_SET_CURRENT_MAX, ":SOUR:CURR %.6f" },
+ { SCPI_CMD_GET_VOLTAGE_TARGET, ":SOUR:VOLT?" },
+ { SCPI_CMD_SET_VOLTAGE_TARGET, ":SOUR:VOLT %.6f" },
+ { SCPI_CMD_GET_CURRENT_LIMIT, ":SOUR:CURR?" },
+ { SCPI_CMD_SET_CURRENT_LIMIT, ":SOUR:CURR %.6f" },
};
SCPI_CMD_GET_MEAS_VOLTAGE,
SCPI_CMD_GET_MEAS_CURRENT,
SCPI_CMD_GET_MEAS_POWER,
- SCPI_CMD_GET_VOLTAGE_MAX,
- SCPI_CMD_SET_VOLTAGE_MAX,
- SCPI_CMD_GET_CURRENT_MAX,
- SCPI_CMD_SET_CURRENT_MAX,
+ SCPI_CMD_GET_VOLTAGE_TARGET,
+ SCPI_CMD_SET_VOLTAGE_TARGET,
+ SCPI_CMD_GET_CURRENT_LIMIT,
+ SCPI_CMD_SET_CURRENT_LIMIT,
SCPI_CMD_GET_OUTPUT_ENABLED,
SCPI_CMD_SET_OUTPUT_ENABLE,
SCPI_CMD_SET_OUTPUT_DISABLE,
"Number of analog channels", NULL},
{SR_CONF_OUTPUT_VOLTAGE, SR_T_FLOAT, "output_voltage",
"Current output voltage", NULL},
- {SR_CONF_OUTPUT_VOLTAGE_MAX, SR_T_FLOAT, "output_voltage_max",
- "Maximum output voltage", NULL},
+ {SR_CONF_OUTPUT_VOLTAGE_TARGET, SR_T_FLOAT, "output_voltage_max",
+ "Output voltage target", NULL},
{SR_CONF_OUTPUT_CURRENT, SR_T_FLOAT, "output_current",
"Current output current", NULL},
- {SR_CONF_OUTPUT_CURRENT_MAX, SR_T_FLOAT, "output_current_max",
- "Maximum output current", NULL},
+ {SR_CONF_OUTPUT_CURRENT_LIMIT, SR_T_FLOAT, "output_current_max",
+ "Output current limit", NULL},
{SR_CONF_OUTPUT_ENABLED, SR_T_BOOL, "output_enabled",
"Output enabled", NULL},
{SR_CONF_OUTPUT_CHANNEL_CONFIG, SR_T_STRING, "output_channel_config",