{
int ret, pg_type;
unsigned int i, j;
- char command[MAX_COMMAND_SIZE];
+ char command[MAX_COMMAND_SIZE], float_str[30];
struct dev_context *devc;
struct scope_config *model;
struct scope_state *state;
if (probe_group != &devc->analog_groups[j - 1])
continue;
state->analog_channels[j - 1].vdiv = (float) p / q;
+ g_ascii_formatd(float_str, sizeof(float_str), "%E", (float) p / q);
g_snprintf(command, sizeof(command),
(*model->scpi_dialect)[SCPI_CMD_SET_VERTICAL_DIV],
- j, state->analog_channels[j-1].vdiv);
+ j, float_str);
if (sr_scpi_send(sdi->conn, command) != SR_OK ||
sr_scpi_get_opc(sdi->conn) != SR_OK)
q != (*model->timebases)[i][1])
continue;
state->timebase = (float) p / q;
+ g_ascii_formatd(float_str, sizeof(float_str), "%E", (float) p / q);
g_snprintf(command, sizeof(command),
(*model->scpi_dialect)[SCPI_CMD_SET_TIMEBASE],
- state->timebase);
+ float_str);
ret = sr_scpi_send(sdi->conn, command);
break;
static const char *hameg_scpi_dialect[] = {
[SCPI_CMD_GET_DIG_DATA] = ":POD%d:DATA?",
[SCPI_CMD_GET_TIMEBASE] = ":TIM:SCAL?",
- [SCPI_CMD_SET_TIMEBASE] = ":TIM:SCAL %E",
+ [SCPI_CMD_SET_TIMEBASE] = ":TIM:SCAL %s",
[SCPI_CMD_GET_COUPLING] = ":CHAN%d:COUP?",
[SCPI_CMD_SET_COUPLING] = ":CHAN%d:COUP %s",
[SCPI_CMD_GET_ANALOG_DATA] = ":CHAN%d:DATA?",
[SCPI_CMD_GET_VERTICAL_DIV] = ":CHAN%d:SCAL?",
- [SCPI_CMD_SET_VERTICAL_DIV] = ":CHAN%d:SCAL %E",
+ [SCPI_CMD_SET_VERTICAL_DIV] = ":CHAN%d:SCAL %s",
[SCPI_CMD_GET_DIG_POD_STATE] = ":POD%d:STAT?",
[SCPI_CMD_SET_DIG_POD_STATE] = ":POD%d:STAT %d",
[SCPI_CMD_GET_TRIGGER_SLOPE] = ":TRIG:A:EDGE:SLOP?",