Use SR_CONF_OUTPUT_VOLTAGE_TARGET and _CURRENT_LIMIT.
These describe them better; the two are fundamentally different things to set.
This commit is contained in:
parent
3982b93840
commit
ca95e90fb3
|
@ -704,32 +704,32 @@ enum sr_configkey {
|
|||
/**
|
||||
* 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.
|
||||
|
|
|
@ -45,9 +45,9 @@ static const uint32_t devopts[] = {
|
|||
|
||||
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,
|
||||
};
|
||||
|
||||
|
@ -240,13 +240,13 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
|
|||
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:
|
||||
|
@ -328,14 +328,14 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
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;
|
||||
|
@ -412,7 +412,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*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++) {
|
||||
|
@ -421,7 +421,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
}
|
||||
*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++) {
|
||||
|
|
|
@ -39,11 +39,11 @@ static const uint32_t devopts[] = {
|
|||
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_CURRENT | SR_CONF_GET,
|
||||
SR_CONF_OUTPUT_CURRENT_MAX | 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,
|
||||
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_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
|
||||
SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
|
||||
};
|
||||
|
||||
/* Note: All models have one power supply output only. */
|
||||
|
@ -235,21 +235,21 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
|
|||
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;
|
||||
}
|
||||
|
@ -282,7 +282,18 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
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;
|
||||
|
@ -302,17 +313,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
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;
|
||||
}
|
||||
|
@ -344,20 +344,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
|
||||
break;
|
||||
case SR_CONF_OUTPUT_CURRENT_MAX:
|
||||
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;
|
||||
else
|
||||
dval = devc->model->current[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_VOLTAGE_TARGET:
|
||||
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
|
||||
/* Min, max, step. */
|
||||
for (idx = 0; idx < 3; idx++) {
|
||||
|
@ -370,6 +357,19 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
}
|
||||
*data = g_variant_builder_end(&gvb);
|
||||
break;
|
||||
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->current_max_device;
|
||||
else
|
||||
dval = devc->model->current[idx];
|
||||
gvar = g_variant_new_double(dval);
|
||||
g_variant_builder_add_value(&gvb, gvar);
|
||||
}
|
||||
*data = g_variant_builder_end(&gvb);
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
}
|
||||
|
|
|
@ -64,9 +64,9 @@ static const uint32_t devopts[] = {
|
|||
/** 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,
|
||||
};
|
||||
|
||||
|
@ -575,13 +575,13 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
|
|||
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:
|
||||
|
@ -664,7 +664,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
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;
|
||||
|
@ -685,7 +685,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
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;
|
||||
|
@ -775,7 +775,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*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++) {
|
||||
|
@ -784,7 +784,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
}
|
||||
*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++) {
|
||||
|
|
|
@ -242,17 +242,17 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
|
|||
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;
|
||||
|
@ -337,13 +337,13 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
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))
|
||||
|
@ -365,13 +365,13 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
|
|||
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))
|
||||
|
@ -475,7 +475,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
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. */
|
||||
|
@ -485,7 +485,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
}
|
||||
*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++) {
|
||||
|
|
|
@ -57,9 +57,9 @@ static const uint32_t rigol_dp800_devopts_cg[] = {
|
|||
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,
|
||||
};
|
||||
|
||||
|
@ -86,10 +86,10 @@ struct scpi_command rigol_dp800_cmd[] = {
|
|||
{ 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" },
|
||||
|
@ -118,8 +118,8 @@ static const uint32_t hp_6632b_devopts[] = {
|
|||
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[] = {
|
||||
|
@ -136,10 +136,10 @@ struct scpi_command hp_6632b_cmd[] = {
|
|||
{ 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" },
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -32,10 +32,10 @@ enum pps_scpi_cmds {
|
|||
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,
|
||||
|
|
|
@ -106,12 +106,12 @@ static struct sr_config_info sr_config_info_data[] = {
|
|||
"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",
|
||||
|
|
Loading…
Reference in New Issue