devc->analog_channels[ch->index] = ch->enabled;
}
} else if (ch->type == SR_CHANNEL_LOGIC) {
- /* Only one list entry for DS1000D series. All channels are retrieved
- * together when this entry is processed. */
+ /* Only one list entry for older protocols. All channels are
+ * retrieved together when this entry is processed. */
if (ch->enabled && (
- devc->model->series->protocol > PROTOCOL_V2 ||
+ devc->model->series->protocol > PROTOCOL_V3 ||
!some_digital))
devc->enabled_channels = g_slist_append(
devc->enabled_channels, ch);
/* Turn on LA module if currently off. */
if (!devc->la_enabled) {
if (rigol_ds_config_set(sdi,
- devc->model->series->protocol >= PROTOCOL_V4 ?
+ devc->model->series->protocol >= PROTOCOL_V3 ?
":LA:STAT ON" : ":LA:DISP ON") != SR_OK)
return SR_ERR;
devc->la_enabled = TRUE;
if (ch->enabled != devc->digital_channels[ch->index]) {
/* Enabled channel is currently disabled, or vice versa. */
if (rigol_ds_config_set(sdi,
- devc->model->series->protocol >= PROTOCOL_V4 ?
+ devc->model->series->protocol >= PROTOCOL_V3 ?
":LA:DIG%d:DISP %s" : ":DIG%d:TURN %s", ch->index,
ch->enabled ? "ON" : "OFF") != SR_OK)
return SR_ERR;
/* Turn off LA module if on and no digital channels selected. */
if (devc->la_enabled && !some_digital)
if (rigol_ds_config_set(sdi,
- devc->model->series->protocol >= PROTOCOL_V4 ?
+ devc->model->series->protocol >= PROTOCOL_V3 ?
":LA:STAT OFF" : ":LA:DISP OFF") != SR_OK)
return SR_ERR;
if (devc->model->series->protocol != PROTOCOL_V3)
return SR_OK;
- if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
- ch->index + 1) != SR_OK)
- return SR_ERR;
+ if (ch->type == SR_CHANNEL_LOGIC) {
+ if (rigol_ds_config_set(sdi->conn, ":WAV:SOUR LA") != SR_OK)
+ return SR_ERR;
+ } else {
+ if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
+ ch->index + 1) != SR_OK)
+ return SR_ERR;
+ }
/* Check that the number of samples will be accepted */
- if (rigol_ds_config_set(sdi, ":WAV:POIN %d", devc->analog_frame_size) != SR_OK)
+ if (rigol_ds_config_set(sdi, ":WAV:POIN %d",
+ ch->type == SR_CHANNEL_LOGIC ?
+ devc->digital_frame_size :
+ devc->analog_frame_size) != SR_OK)
return SR_ERR;
if (sr_scpi_get_int(sdi->conn, "*ESR?", &tmp) != SR_OK)
return SR_ERR;
rigol_ds_set_wait_event(devc, WAIT_NONE);
break;
case PROTOCOL_V3:
- if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
- ch->index + 1) != SR_OK)
- return SR_ERR;
+ if (ch->type == SR_CHANNEL_LOGIC) {
+ if (rigol_ds_config_set(sdi->conn, ":WAV:SOUR LA") != SR_OK)
+ return SR_ERR;
+ } else {
+ if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
+ ch->index + 1) != SR_OK)
+ return SR_ERR;
+ }
if (devc->data_source != DATA_SOURCE_LIVE) {
if (rigol_ds_config_set(sdi, ":WAV:RES") != SR_OK)
return SR_ERR;
/* Digital channel state. */
if (devc->model->has_digital) {
if (sr_scpi_get_bool(sdi->conn,
- devc->model->series->protocol >= PROTOCOL_V4 ?
+ devc->model->series->protocol >= PROTOCOL_V3 ?
":LA:STAT?" : ":LA:DISP?",
&devc->la_enabled) != SR_OK)
return SR_ERR;
devc->la_enabled ? "enabled" : "disabled");
for (i = 0; i < ARRAY_SIZE(devc->digital_channels); i++) {
cmd = g_strdup_printf(
- devc->model->series->protocol >= PROTOCOL_V4 ?
+ devc->model->series->protocol >= PROTOCOL_V3 ?
":LA:DIG%d:DISP?" : ":DIG%d:TURN?", i);
res = sr_scpi_get_bool(sdi->conn, cmd, &devc->digital_channels[i]);
g_free(cmd);