* Each data block has a trailing linefeed too.
*/
-static int get_cfg(const struct sr_dev_inst *sdi, char *cmd, char *reply, size_t maxlen);
-static int get_cfg_int(const struct sr_dev_inst *sdi, char *cmd, int *i);
-
static int parse_int(const char *str, int *ret)
{
char *e;
*/
static int rigol_ds_event_wait(const struct sr_dev_inst *sdi, char status1, char status2)
{
- char buf[20];
+ char *buf;
struct dev_context *devc;
time_t start;
return SR_ERR_TIMEOUT;
}
- if (get_cfg(sdi, ":TRIG:STAT?", buf, sizeof(buf)) != SR_OK)
+ if (sr_scpi_get_string(sdi->conn, ":TRIG:STAT?", &buf) != SR_OK)
return SR_ERR;
} while (buf[0] == status1 || buf[0] == status2);
return SR_ERR_TIMEOUT;
}
- if (get_cfg(sdi, ":TRIG:STAT?", buf, sizeof(buf)) != SR_OK)
+ if (sr_scpi_get_string(sdi->conn, ":TRIG:STAT?", &buf) != SR_OK)
return SR_ERR;
} while (buf[0] != status1 && buf[0] != status2);
* If timebase < 50 msecs/DIV just sleep about one sweep time except
* for really fast sweeps.
*/
- if (devc->timebase < 0.0499)
- {
+ if (devc->timebase < 0.0499) {
if (devc->timebase > 0.99e-6) {
/*
* Timebase * num hor. divs * 85(%) * 1e6(usecs) / 100
static int rigol_ds_check_stop(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
+ struct sr_probe *probe;
int tmp;
if (!(devc = sdi->priv))
return SR_ERR;
+ probe = devc->channel_entry->data;
+
if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN%d",
- devc->channel->index + 1) != SR_OK)
+ probe->index + 1) != SR_OK)
return SR_ERR;
/* Check that the number of samples will be accepted */
if (sr_scpi_send(sdi->conn, ":WAV:POIN %d;*OPC", devc->analog_frame_size) != SR_OK)
return SR_ERR;
- if (get_cfg_int(sdi, "*ESR?", &tmp) != SR_OK)
+ if (sr_scpi_get_int(sdi->conn, "*ESR?", &tmp) != SR_OK)
return SR_ERR;
/*
* If we get an "Execution error" the scope went from "Single" to
/* Wait for enough data becoming available in scope output buffer */
static int rigol_ds_block_wait(const struct sr_dev_inst *sdi)
{
- char buf[30];
+ char *buf;
struct dev_context *devc;
time_t start;
int len;
g_usleep(devc->analog_frame_size < 15000 ? 100000 : 1000000);
/* "READ,nnnn" (still working) or "IDLE,nnnn" (finished) */
- if (get_cfg(sdi, ":WAV:STAT?", buf, sizeof(buf)) != SR_OK)
+ if (sr_scpi_get_string(sdi->conn, ":WAV:STAT?", &buf) != SR_OK)
return SR_ERR;
if (parse_int(buf + 5, &len) != SR_OK)
SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
+ struct sr_probe *probe;
if (!(devc = sdi->priv))
return SR_ERR;
- sr_dbg("Starting reading data from channel %d",
- devc->channel->index + 1);
+ probe = devc->channel_entry->data;
- if (devc->model->protocol == PROTOCOL_LEGACY) {
- if (devc->channel->type == SR_DF_LOGIC) {
+ sr_dbg("Starting reading data from channel %d", probe->index + 1);
+
+ if (devc->model->series < RIGOL_DS1000Z) {
+ if (probe->type == SR_PROBE_LOGIC) {
if (sr_scpi_send(sdi->conn, ":WAV:DATA? DIG") != SR_OK)
return SR_ERR;
} else {
- if (sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%c",
- devc->channel->name[2]) != SR_OK)
+ if (sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%d",
+ probe->index + 1) != SR_OK)
return SR_ERR;
}
} else {
if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN%d",
- devc->channel->index + 1) != SR_OK)
+ probe->index + 1) != SR_OK)
return SR_ERR;
if (devc->data_source != DATA_SOURCE_LIVE) {
if (sr_scpi_send(sdi->conn, ":WAV:RES") != SR_OK)
rigol_ds_set_wait_event(devc, WAIT_NONE);
}
- devc->num_frame_samples = 0;
+ devc->num_channel_bytes = 0;
devc->num_block_bytes = 0;
return SR_OK;
int len, tmp;
/* Read the hashsign and length digit. */
- tmp = sr_scpi_read(scpi, start, 2);
+ tmp = sr_scpi_read_data(scpi, start, 2);
start[2] = '\0';
- if (tmp != 2)
- {
+ if (tmp != 2) {
sr_err("Failed to read first two bytes of data block header.");
return -1;
}
- if (start[0] != '#' || !isdigit(start[1]) || start[1] == '0')
- {
+ if (start[0] != '#' || !isdigit(start[1]) || start[1] == '0') {
sr_err("Received invalid data block header start '%s'.", start);
return -1;
}
len = atoi(start + 1);
/* Read the data length. */
- tmp = sr_scpi_read(scpi, length, len);
+ tmp = sr_scpi_read_data(scpi, length, len);
length[len] = '\0';
- if (tmp != len)
- {
+ if (tmp != len) {
sr_err("Failed to read %d bytes of data block length.", len);
return -1;
}
- if (parse_int(length, &len) != SR_OK)
- {
+ if (parse_int(length, &len) != SR_OK) {
sr_err("Received invalid data block length '%s'.", length);
return -1;
}
double vdiv, offset;
int len, i, vref;
struct sr_probe *probe;
+ gsize expected_data_bytes;
(void)fd;
scpi = sdi->conn;
- if (revents == G_IO_IN) {
- if (devc->model->protocol == PROTOCOL_IEEE488_2) {
+ if (revents == G_IO_IN || revents == 0) {
+ if (devc->model->series >= RIGOL_DS1000Z) {
switch(devc->wait_event) {
case WAIT_NONE:
break;
-
case WAIT_TRIGGER:
if (rigol_ds_trigger_wait(sdi) != SR_OK)
return TRUE;
if (rigol_ds_channel_start(sdi) != SR_OK)
return TRUE;
break;
-
case WAIT_BLOCK:
if (rigol_ds_block_wait(sdi) != SR_OK)
return TRUE;
break;
-
case WAIT_STOP:
if (rigol_ds_stop_wait(sdi) != SR_OK)
return TRUE;
if (rigol_ds_channel_start(sdi) != SR_OK)
return TRUE;
return TRUE;
-
default:
sr_err("BUG: Unknown event target encountered");
}
}
- probe = devc->channel;
-
- if (devc->num_block_bytes == 0) {
- if (devc->model->protocol == PROTOCOL_IEEE488_2) {
- sr_dbg("New block header expected");
+ probe = devc->channel_entry->data;
+
+ expected_data_bytes = probe->type == SR_PROBE_ANALOG ?
+ devc->analog_frame_size : devc->digital_frame_size;
+
+ if (devc->num_block_bytes == 0 &&
+ devc->model->series >= RIGOL_DS1000Z) {
if (sr_scpi_send(sdi->conn, ":WAV:DATA?") != SR_OK)
return TRUE;
+ }
+
+ if (devc->num_block_bytes == 0) {
+
+ if (sr_scpi_read_begin(scpi) != SR_OK)
+ return TRUE;
+
+ if (devc->protocol == PROTOCOL_IEEE488_2) {
+ sr_dbg("New block header expected");
len = rigol_ds_read_header(scpi);
if (len == -1)
return TRUE;
* appear eventually.
*/
if (devc->data_source == DATA_SOURCE_LIVE
- && (unsigned)len < devc->num_frame_samples) {
+ && (unsigned)len < expected_data_bytes) {
sr_dbg("Discarding short data block");
- sr_scpi_read(scpi, (char *)devc->buffer, len + 1);
+ sr_scpi_read_data(scpi, (char *)devc->buffer, len + 1);
return TRUE;
}
devc->num_block_bytes = len;
} else {
- devc->num_block_bytes = probe->type == SR_PROBE_ANALOG ?
- (devc->model->series == RIGOL_VS5000 ?
- VS5000_ANALOG_LIVE_WAVEFORM_SIZE :
- DS1000_ANALOG_LIVE_WAVEFORM_SIZE) :
- DIGITAL_WAVEFORM_SIZE;
+ devc->num_block_bytes = expected_data_bytes;
}
devc->num_block_read = 0;
}
len = devc->num_block_bytes - devc->num_block_read;
- len = sr_scpi_read(scpi, (char *)devc->buffer,
+ len = sr_scpi_read_data(scpi, (char *)devc->buffer,
len < ACQ_BUFFER_SIZE ? len : ACQ_BUFFER_SIZE);
sr_dbg("Received %d bytes.", len);
if (len == -1)
return TRUE;
- if (devc->num_frame_samples == 0) {
- /* Start of a new frame. */
- packet.type = SR_DF_FRAME_BEGIN;
- sr_session_send(sdi, &packet);
- }
+ devc->num_block_read += len;
if (probe->type == SR_PROBE_ANALOG) {
- if (devc->model->protocol == PROTOCOL_IEEE488_2)
- devc->num_block_read += len;
vref = devc->vert_reference[probe->index];
vdiv = devc->vdiv[probe->index] / 25.6;
offset = devc->vert_offset[probe->index];
- if (devc->model->protocol == PROTOCOL_IEEE488_2)
+ if (devc->model->series >= RIGOL_DS1000Z)
for (i = 0; i < len; i++)
devc->data[i] = ((int)devc->buffer[i] - vref) * vdiv - offset;
else
packet.payload = &analog;
sr_session_send(cb_data, &packet);
g_slist_free(analog.probes);
-
- if (devc->model->protocol == PROTOCOL_IEEE488_2) {
- if (devc->num_block_read == devc->num_block_bytes) {
- sr_dbg("Block has been completed");
- /* Discard the terminating linefeed and prepare for
- possible next block */
- sr_scpi_read(scpi, (char *)devc->buffer, 1);
- devc->num_block_bytes = 0;
- if (devc->data_source != DATA_SOURCE_LIVE)
- rigol_ds_set_wait_event(devc, WAIT_BLOCK);
- } else
- sr_dbg("%d of %d block bytes read", devc->num_block_read, devc->num_block_bytes);
- }
-
- devc->num_frame_samples += len;
-
- if (devc->num_frame_samples < devc->analog_frame_size)
- /* Don't have the whole frame yet. */
- return TRUE;
-
- sr_dbg("Frame completed, %d samples", devc->num_frame_samples);
} else {
- logic.length = len - 10;
+ logic.length = len;
logic.unitsize = 2;
- logic.data = devc->buffer + 10;
+ logic.data = devc->buffer;
packet.type = SR_DF_LOGIC;
packet.payload = &logic;
sr_session_send(cb_data, &packet);
+ }
- if (len != DIGITAL_WAVEFORM_SIZE)
- /* Don't have the whole frame yet. */
+ if (devc->num_block_read == devc->num_block_bytes) {
+ sr_dbg("Block has been completed");
+ if (devc->model->series >= RIGOL_DS1000Z) {
+ /* Discard the terminating linefeed */
+ sr_scpi_read_data(scpi, (char *)devc->buffer, 1);
+ }
+ if (devc->protocol == PROTOCOL_IEEE488_2) {
+ /* Prepare for possible next block */
+ devc->num_block_bytes = 0;
+ if (devc->data_source != DATA_SOURCE_LIVE)
+ rigol_ds_set_wait_event(devc, WAIT_BLOCK);
+ }
+ if (!sr_scpi_read_complete(scpi)) {
+ sr_err("Read should have been completed");
+ sdi->driver->dev_acquisition_stop(sdi, cb_data);
return TRUE;
+ }
+ devc->num_block_read = 0;
+ } else {
+ sr_dbg("%d of %d block bytes read", devc->num_block_read, devc->num_block_bytes);
}
- /* End of the frame. */
- packet.type = SR_DF_FRAME_END;
- sr_session_send(sdi, &packet);
- if (devc->model->protocol == PROTOCOL_IEEE488_2) {
+ devc->num_channel_bytes += len;
+
+ if (devc->num_channel_bytes < expected_data_bytes)
+ /* Don't have the full data for this channel yet, re-run. */
+ return TRUE;
+
+ /* End of data for this channel. */
+ if (devc->model->series >= RIGOL_DS1000Z) {
/* Signal end of data download to scope */
if (devc->data_source != DATA_SOURCE_LIVE)
/*
sr_scpi_send(sdi->conn, ":WAV:END");
}
- if (devc->enabled_analog_probes
- && devc->channel == devc->enabled_analog_probes->data
- && devc->enabled_analog_probes->next != NULL) {
- /* We got the frame for the first analog channel, but
- * there's a second analog channel. */
- devc->channel = devc->enabled_analog_probes->next->data;
+ if (probe->type == SR_PROBE_ANALOG
+ && devc->channel_entry->next != NULL) {
+ /* We got the frame for this analog channel, but
+ * there's another analog channel. */
+ devc->channel_entry = devc->channel_entry->next;
rigol_ds_channel_start(sdi);
} else {
- /* Done with both analog channels in this frame. */
+ /* Done with all analog channels in this frame. */
if (devc->enabled_digital_probes
- && devc->channel != devc->enabled_digital_probes->data) {
+ && devc->channel_entry != devc->enabled_digital_probes) {
/* Now we need to get the digital data. */
- devc->channel = devc->enabled_digital_probes->data;
+ devc->channel_entry = devc->enabled_digital_probes;
rigol_ds_channel_start(sdi);
- } else if (++devc->num_frames == devc->limit_frames) {
- /* End of last frame. */
- packet.type = SR_DF_END;
- sr_session_send(sdi, &packet);
- sdi->driver->dev_acquisition_stop(sdi, cb_data);
} else {
- /* Get the next frame, starting with the first analog channel. */
- if (devc->enabled_analog_probes)
- devc->channel = devc->enabled_analog_probes->data;
- else
- devc->channel = devc->enabled_digital_probes->data;
-
- if (devc->model->protocol == PROTOCOL_LEGACY)
- rigol_ds_channel_start(sdi);
- else
- rigol_ds_capture_start(sdi);
+ /* Done with this frame. */
+ packet.type = SR_DF_FRAME_END;
+ sr_session_send(cb_data, &packet);
+
+ if (++devc->num_frames == devc->limit_frames) {
+ /* Last frame, stop capture. */
+ sdi->driver->dev_acquisition_stop(sdi, cb_data);
+ } else {
+ /* Get the next frame, starting with the first analog channel. */
+ if (devc->enabled_analog_probes)
+ devc->channel_entry = devc->enabled_analog_probes;
+ else
+ devc->channel_entry = devc->enabled_digital_probes;
+
+ if (devc->model->series < RIGOL_DS1000Z)
+ rigol_ds_channel_start(sdi);
+ else
+ rigol_ds_capture_start(sdi);
+
+ /* Start of next frame. */
+ packet.type = SR_DF_FRAME_BEGIN;
+ sr_session_send(cb_data, &packet);
+ }
}
}
}
return TRUE;
}
-static int get_cfg(const struct sr_dev_inst *sdi, char *cmd, char *reply, size_t maxlen)
-{
- int len;
- struct dev_context *devc = sdi->priv;
- struct sr_scpi_dev_inst *scpi = sdi->conn;
- char *response;
-
- if (sr_scpi_send(scpi, cmd) != SR_OK)
- return SR_ERR;
-
- if (sr_scpi_receive(scpi, &response) != SR_OK)
- return SR_ERR;
-
- g_strlcpy(reply, response, maxlen);
- g_free(response);
- len = strlen(reply);
-
- if (devc->model->protocol == PROTOCOL_IEEE488_2) {
- /* get rid of trailing linefeed */
- if (len >= 1 && reply[len-1] == '\n')
- reply[len-1] = '\0';
- }
-
- sr_spew("Received '%s'.", reply);
-
- return SR_OK;
-}
-
-static int get_cfg_int(const struct sr_dev_inst *sdi, char *cmd, int *i)
-{
- char buf[32];
-
- if (get_cfg(sdi, cmd, buf, sizeof(buf)) != SR_OK)
- return SR_ERR;
-
- if (parse_int(buf, i) != SR_OK)
- return SR_ERR;
-
- return SR_OK;
-}
-
-static int get_cfg_float(const struct sr_dev_inst *sdi, char *cmd, float *f)
-{
- char buf[32], *e;
-
- if (get_cfg(sdi, cmd, buf, sizeof(buf)) != SR_OK)
- return SR_ERR;
- *f = strtof(buf, &e);
- if (e == buf || (fpclassify(*f) & (FP_ZERO | FP_NORMAL)) == 0) {
- sr_dbg("failed to parse response to '%s': '%s'", cmd, buf);
- return SR_ERR;
- }
-
- return SR_OK;
-}
-
-static int get_cfg_string(const struct sr_dev_inst *sdi, char *cmd, char **buf)
-{
- if (!(*buf = g_try_malloc0(256)))
- return SR_ERR_MALLOC;
-
- if (get_cfg(sdi, cmd, *buf, 256) != SR_OK)
- return SR_ERR;
-
- return SR_OK;
-}
-
SR_PRIV int rigol_ds_get_dev_cfg(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
char *t_s, *cmd;
- int i, res;
+ unsigned int i;
+ int res;
devc = sdi->priv;
/* Analog channel state. */
- if (get_cfg_string(sdi, ":CHAN1:DISP?", &t_s) != SR_OK)
- return SR_ERR;
- devc->analog_channels[0] = !strcmp(t_s, "ON") || !strcmp(t_s, "1");
- g_free(t_s);
- if (get_cfg_string(sdi, ":CHAN2:DISP?", &t_s) != SR_OK)
- return SR_ERR;
- devc->analog_channels[1] = !strcmp(t_s, "ON") || !strcmp(t_s, "1");
- g_free(t_s);
- sr_dbg("Current analog channel state CH1 %s CH2 %s",
- devc->analog_channels[0] ? "on" : "off",
- devc->analog_channels[1] ? "on" : "off");
+ for (i = 0; i < devc->model->analog_channels; i++) {
+ cmd = g_strdup_printf(":CHAN%d:DISP?", i + 1);
+ res = sr_scpi_get_string(sdi->conn, cmd, &t_s);
+ g_free(cmd);
+ if (res != SR_OK)
+ return SR_ERR;
+ devc->analog_channels[i] = !strcmp(t_s, "ON") || !strcmp(t_s, "1");
+ }
+ sr_dbg("Current analog channel state:");
+ for (i = 0; i < devc->model->analog_channels; i++)
+ sr_dbg("CH%d %s", i + 1, devc->analog_channels[i] ? "on" : "off");
/* Digital channel state. */
if (devc->model->has_digital) {
- sr_dbg("Current digital channel state:");
+ if (sr_scpi_get_string(sdi->conn, ":LA:DISP?", &t_s) != SR_OK)
+ return SR_ERR;
+ devc->la_enabled = !strcmp(t_s, "ON") ? TRUE : FALSE;
+ sr_dbg("Logic analyzer %s, current digital channel state:",
+ devc->la_enabled ? "enabled" : "disabled");
for (i = 0; i < 16; i++) {
cmd = g_strdup_printf(":DIG%d:TURN?", i);
- res = get_cfg_string(sdi, cmd, &t_s);
+ res = sr_scpi_get_string(sdi->conn, cmd, &t_s);
g_free(cmd);
if (res != SR_OK)
return SR_ERR;
}
/* Timebase. */
- if (get_cfg_float(sdi, ":TIM:SCAL?", &devc->timebase) != SR_OK)
+ if (sr_scpi_get_float(sdi->conn, ":TIM:SCAL?", &devc->timebase) != SR_OK)
return SR_ERR;
sr_dbg("Current timebase %g", devc->timebase);
/* Vertical gain. */
- if (get_cfg_float(sdi, ":CHAN1:SCAL?", &devc->vdiv[0]) != SR_OK)
- return SR_ERR;
- if (get_cfg_float(sdi, ":CHAN2:SCAL?", &devc->vdiv[1]) != SR_OK)
- return SR_ERR;
- sr_dbg("Current vertical gain CH1 %g CH2 %g", devc->vdiv[0], devc->vdiv[1]);
+ for (i = 0; i < devc->model->analog_channels; i++) {
+ cmd = g_strdup_printf(":CHAN%d:SCAL?", i + 1);
+ res = sr_scpi_get_float(sdi->conn, cmd, &devc->vdiv[i]);
+ g_free(cmd);
+ if (res != SR_OK)
+ return SR_ERR;
+ }
+ sr_dbg("Current vertical gain:");
+ for (i = 0; i < devc->model->analog_channels; i++)
+ sr_dbg("CH%d %g", i + 1, devc->vdiv[i]);
- if (devc->model->protocol == PROTOCOL_IEEE488_2) {
+ sr_dbg("Current vertical reference:");
+ if (devc->model->series >= RIGOL_DS1000Z) {
/* Vertical reference - not certain if this is the place to read it. */
- if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN1") != SR_OK)
- return SR_ERR;
- if (get_cfg_int(sdi, ":WAV:YREF?", &devc->vert_reference[0]) != SR_OK)
- return SR_ERR;
- if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN2") != SR_OK)
- return SR_ERR;
- if (get_cfg_int(sdi, ":WAV:YREF?", &devc->vert_reference[1]) != SR_OK)
- return SR_ERR;
- sr_dbg("Current vertical reference CH1 %d CH2 %d",
- devc->vert_reference[0], devc->vert_reference[1]);
+ for (i = 0; i < devc->model->analog_channels; i++) {
+ if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN%d", i + 1) != SR_OK)
+ return SR_ERR;
+ if (sr_scpi_get_int(sdi->conn, ":WAV:YREF?", &devc->vert_reference[i]) != SR_OK)
+ return SR_ERR;
+ sr_dbg("CH%d %d", i + 1, devc->vert_reference[i]);
+ }
}
/* Vertical offset. */
- if (get_cfg_float(sdi, ":CHAN1:OFFS?", &devc->vert_offset[0]) != SR_OK)
- return SR_ERR;
- if (get_cfg_float(sdi, ":CHAN2:OFFS?", &devc->vert_offset[1]) != SR_OK)
- return SR_ERR;
- sr_dbg("Current vertical offset CH1 %g CH2 %g", devc->vert_offset[0],
- devc->vert_offset[1]);
+ for (i = 0; i < devc->model->analog_channels; i++) {
+ cmd = g_strdup_printf(":CHAN%d:OFFS?", i + 1);
+ res = sr_scpi_get_float(sdi->conn, cmd, &devc->vert_offset[i]);
+ g_free(cmd);
+ if (res != SR_OK)
+ return SR_ERR;
+ }
+ sr_dbg("Current vertical offset:");
+ for (i = 0; i < devc->model->analog_channels; i++)
+ sr_dbg("CH%d %g", i + 1, devc->vert_offset[i]);
/* Coupling. */
- if (get_cfg_string(sdi, ":CHAN1:COUP?", &devc->coupling[0]) != SR_OK)
- return SR_ERR;
- if (get_cfg_string(sdi, ":CHAN2:COUP?", &devc->coupling[1]) != SR_OK)
- return SR_ERR;
- sr_dbg("Current coupling CH1 %s CH2 %s", devc->coupling[0],
- devc->coupling[1]);
+ for (i = 0; i < devc->model->analog_channels; i++) {
+ cmd = g_strdup_printf(":CHAN%d:COUP?", i + 1);
+ res = sr_scpi_get_string(sdi->conn, cmd, &devc->coupling[i]);
+ g_free(cmd);
+ if (res != SR_OK)
+ return SR_ERR;
+ }
+ sr_dbg("Current coupling:");
+ for (i = 0; i < devc->model->analog_channels; i++)
+ sr_dbg("CH%d %s", i + 1, devc->coupling[i]);
/* Trigger source. */
- if (get_cfg_string(sdi, ":TRIG:EDGE:SOUR?", &devc->trigger_source) != SR_OK)
+ if (sr_scpi_get_string(sdi->conn, ":TRIG:EDGE:SOUR?", &devc->trigger_source) != SR_OK)
return SR_ERR;
sr_dbg("Current trigger source %s", devc->trigger_source);
/* Horizontal trigger position. */
- if (get_cfg_float(sdi, ":TIM:OFFS?", &devc->horiz_triggerpos) != SR_OK)
+ if (sr_scpi_get_float(sdi->conn, ":TIM:OFFS?", &devc->horiz_triggerpos) != SR_OK)
return SR_ERR;
sr_dbg("Current horizontal trigger position %g", devc->horiz_triggerpos);
/* Trigger slope. */
- if (get_cfg_string(sdi, ":TRIG:EDGE:SLOP?", &devc->trigger_slope) != SR_OK)
+ if (sr_scpi_get_string(sdi->conn, ":TRIG:EDGE:SLOP?", &devc->trigger_slope) != SR_OK)
return SR_ERR;
sr_dbg("Current trigger slope %s", devc->trigger_slope);