SR_CONF_SAMPLERATE | SR_CONF_GET,
SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_HDIV | SR_CONF_GET,
SR_CONF_SAMPLERATE | SR_CONF_GET,
SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_HDIV | SR_CONF_GET,
{SERIES(DS1000), "DS1052E", {5, 1000000000}, CH_INFO(2, false), std_cmd},
{SERIES(DS1000), "DS1102E", {2, 1000000000}, CH_INFO(2, false), std_cmd},
{SERIES(DS1000), "DS1152E", {2, 1000000000}, CH_INFO(2, false), std_cmd},
{SERIES(DS1000), "DS1052E", {5, 1000000000}, CH_INFO(2, false), std_cmd},
{SERIES(DS1000), "DS1102E", {2, 1000000000}, CH_INFO(2, false), std_cmd},
{SERIES(DS1000), "DS1152E", {2, 1000000000}, CH_INFO(2, false), std_cmd},
{SERIES(DS1000), "DS1052D", {5, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(DS1000), "DS1102D", {2, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(DS1000), "DS1152D", {2, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(DS1000), "DS1052D", {5, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(DS1000), "DS1102D", {2, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(DS1000), "DS1152D", {2, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(DS1000Z), "DS1104Z-S", {5, 1000000000}, CH_INFO(4, false), std_cmd},
{SERIES(DS1000Z), "DS1074Z Plus", {5, 1000000000}, CH_INFO(4, false), std_cmd},
{SERIES(DS1000Z), "DS1104Z Plus", {5, 1000000000}, CH_INFO(4, false), std_cmd},
{SERIES(DS1000Z), "DS1104Z-S", {5, 1000000000}, CH_INFO(4, false), std_cmd},
{SERIES(DS1000Z), "DS1074Z Plus", {5, 1000000000}, CH_INFO(4, false), std_cmd},
{SERIES(DS1000Z), "DS1104Z Plus", {5, 1000000000}, CH_INFO(4, false), std_cmd},
+ {SERIES(DS1000Z), "DS1102Z-E", {2, 1000000000}, CH_INFO(2, false), std_cmd},
+ {SERIES(DS1000Z), "DS1202Z-E", {2, 1000000000}, CH_INFO(2, false), std_cmd},
{SERIES(DS1000Z), "MSO1074Z", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS1000Z), "MSO1104Z", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS1000Z), "MSO1074Z-S", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS1000Z), "MSO1104Z-S", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS1000Z), "MSO1074Z", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS1000Z), "MSO1104Z", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS1000Z), "MSO1074Z-S", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS1000Z), "MSO1104Z-S", {5, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS4000), "DS4024", {1, 1000000000}, CH_INFO(4, false), std_cmd},
{SERIES(MSO5000), "MSO5072", {1, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(MSO5000), "MSO5074", {1, 1000000000}, CH_INFO(4, true), std_cmd},
{SERIES(DS4000), "DS4024", {1, 1000000000}, CH_INFO(4, false), std_cmd},
{SERIES(MSO5000), "MSO5072", {1, 1000000000}, CH_INFO(2, true), std_cmd},
{SERIES(MSO5000), "MSO5074", {1, 1000000000}, CH_INFO(4, true), std_cmd},
channel_name = g_strdup_printf("CH%d", i + 1);
ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_name);
channel_name = g_strdup_printf("CH%d", i + 1);
ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_name);
for (i = 0; i < ARRAY_SIZE(devc->digital_channels); i++) {
channel_name = g_strdup_printf("D%d", i);
ch = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_name);
for (i = 0; i < ARRAY_SIZE(devc->digital_channels); i++) {
channel_name = g_strdup_printf("D%d", i);
ch = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_name);
devc->digital_group->channels = g_slist_append(
devc->digital_group->channels, ch);
}
devc->digital_group->channels = g_slist_append(
devc->digital_group->channels, ch);
}
- if (devc->data_source == DATA_SOURCE_LIVE) {
- samplerate = analog_frame_size(sdi) /
- (devc->timebase * devc->model->series->num_horizontal_divs);
- *data = g_variant_new_uint64(samplerate);
- } else {
- sr_dbg("Unknown data source: %d.", devc->data_source);
- return SR_ERR_NA;
- }
+ *data = g_variant_new_uint64(devc->sample_rate);
break;
case SR_CONF_TRIGGER_SOURCE:
if (!strcmp(devc->trigger_source, "ACL"))
break;
case SR_CONF_TRIGGER_SOURCE:
if (!strcmp(devc->trigger_source, "ACL"))
/* Only one list entry for older protocols. All channels are
* retrieved together when this entry is processed. */
if (ch->enabled && (
/* Only one list entry for older protocols. All channels are
* retrieved together when this entry is processed. */
if (ch->enabled && (
!some_digital))
devc->enabled_channels = g_slist_append(
devc->enabled_channels, ch);
!some_digital))
devc->enabled_channels = g_slist_append(
devc->enabled_channels, ch);
}
if (ch->enabled != devc->digital_channels[ch->index]) {
/* Enabled channel is currently disabled, or vice versa. */
}
if (ch->enabled != devc->digital_channels[ch->index]) {
/* Enabled channel is currently disabled, or vice versa. */
- sr_err("Data source 'Segmented' not yet supported");
- return SR_ERR;
+ switch (protocol) {
+ case PROTOCOL_V1:
+ case PROTOCOL_V2:
+ /* V1 and V2 do not have segmented data */
+ sr_err("Data source 'Segmented' not supported on this model");
+ break;
+ case PROTOCOL_V3:
+ case PROTOCOL_V4:
+ {
+ int frames = 0;
+ if (sr_scpi_get_int(sdi->conn,
+ protocol == PROTOCOL_V4 ? "FUNC:WREP:FEND?" :
+ "FUNC:WREP:FMAX?", &frames) != SR_OK)
+ return SR_ERR;
+ if (frames <= 0) {
+ sr_err("No segmented data available");
+ return SR_ERR;
+ }
+ devc->num_frames_segmented = frames;
+ break;
+ }
+ case PROTOCOL_V5:
+ /* The frame limit has to be read on the fly, just set up
+ * reading of the first frame */
+ if (rigol_ds_config_set(sdi, "REC:CURR 1") != SR_OK)
+ return SR_ERR;
+ break;
+ default:
+ sr_err("Data source 'Segmented' not yet supported");
+ return SR_ERR;
+ }
+ if (devc->data_source == DATA_SOURCE_LIVE) {
+ devc->sample_rate = analog_frame_size(sdi) /
+ (devc->timebase * devc->model->series->num_horizontal_divs);
+ } else {
+ float xinc;
+ if (devc->model->series->protocol < PROTOCOL_V3) {
+ sr_err("Cannot get samplerate (below V3).");
+ return SR_ERR;
+ }
+ ret = sr_scpi_get_float(sdi->conn, "WAV:XINC?", &xinc);
+ if (ret != SR_OK) {
+ sr_err("Cannot get samplerate (WAV:XINC? failed).");
+ return SR_ERR;
+ }
+ if (!xinc) {
+ sr_err("Cannot get samplerate (zero XINC value).");
+ return SR_ERR;
+ }
+ devc->sample_rate = 1. / xinc;
+ }
+