Skip to content

Commit f91fb2a

Browse files
author
Frederic Borry
committed
Added support for SDS2000X HD models based on the work of gralco (Eric Kuzmenko) in this PR : github.com/sigrokproject/pull/176/
Created a new protocol version "E11" matching the latest Siglent SDS Scope programming guide. Reduced the read-wait time from 7sec to 50ms for better performance (achived by looping on read sample logic to consume the data has it arrives). Tested with SDS2504X HD model connected via Ethernet cable.
1 parent b503d24 commit f91fb2a

File tree

4 files changed

+427
-107
lines changed

4 files changed

+427
-107
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,4 @@ stamp-h?
8080
/tests/*.log
8181
/tests/*.trs
8282
/tests/main
83+
.vscode/

src/hardware/siglent-sds/api.c

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ enum series {
171171
SDS1000XP,
172172
SDS1000XE,
173173
SDS2000X,
174+
SDS2000XP,
175+
SDS2000XHD,
174176
};
175177

176178
/* short name, full name */
@@ -183,19 +185,23 @@ static const struct siglent_sds_vendor supported_vendors[] = {
183185
* number of vertical divs, live waveform samples, memory buffer samples */
184186
static const struct siglent_sds_series supported_series[] = {
185187
[SDS1000CML] = {VENDOR(SIGLENT), "SDS1000CML", NON_SPO_MODEL,
186-
{ 50, 1 }, { 2, 1000 }, 18, 8, 1400363},
188+
{ 50, 1 }, { 2, 1000 }, 18, 8, 25, 1400363},
187189
[SDS1000CNL] = {VENDOR(SIGLENT), "SDS1000CNL", NON_SPO_MODEL,
188-
{ 50, 1 }, { 2, 1000 }, 18, 8, 1400363},
190+
{ 50, 1 }, { 2, 1000 }, 18, 8, 25, 1400363},
189191
[SDS1000DL] = {VENDOR(SIGLENT), "SDS1000DL", NON_SPO_MODEL,
190-
{ 50, 1 }, { 2, 1000 }, 18, 8, 1400363},
192+
{ 50, 1 }, { 2, 1000 }, 18, 8, 25, 1400363},
191193
[SDS1000X] = {VENDOR(SIGLENT), "SDS1000X", SPO_MODEL,
192-
{ 50, 1 }, { 500, 100000 }, 14, 8, 14000363},
194+
{ 50, 1 }, { 500, 100000 }, 14, 8, 25, 14000363},
193195
[SDS1000XP] = {VENDOR(SIGLENT), "SDS1000X+", SPO_MODEL,
194-
{ 50, 1 }, { 500, 100000 }, 14, 8, 14000363},
196+
{ 50, 1 }, { 500, 100000 }, 14, 8, 25, 14000363},
195197
[SDS1000XE] = {VENDOR(SIGLENT), "SDS1000XE", ESERIES,
196-
{ 50, 1 }, { 500, 100000 }, 14, 8, 14000363},
198+
{ 50, 1 }, { 500, 100000 }, 14, 8, 25, 14000363},
197199
[SDS2000X] = {VENDOR(SIGLENT), "SDS2000X", SPO_MODEL,
198-
{ 50, 1 }, { 500, 100000 }, 14, 8, 14000363},
200+
{ 50, 1 }, { 500, 100000 }, 14, 8, 25, 14000363},
201+
[SDS2000XP] = {VENDOR(SIGLENT), "SDS2000X+", E11,
202+
{ 100, 1 }, { 500, 100000 }, 10, 8, 30, 14000363},
203+
[SDS2000XHD] = {VENDOR(SIGLENT), "SDS2000XHD", E11,
204+
{ 100, 1 }, { 500, 100000 }, 10, 8, 30, 14000363},
199205
};
200206

201207
#define SERIES(x) &supported_series[x]
@@ -227,6 +233,15 @@ static const struct siglent_sds_model supported_models[] = {
227233
{ SERIES(SDS2000X), "SDS2204X", { 2, 1000000000 }, 4, FALSE, 0 },
228234
{ SERIES(SDS2000X), "SDS2302X", { 2, 1000000000 }, 2, FALSE, 0 },
229235
{ SERIES(SDS2000X), "SDS2304X", { 2, 1000000000 }, 4, FALSE, 0 },
236+
{ SERIES(SDS2000XP), "SDS2102X Plus", { 1, 1000000000 }, 2, TRUE, 16 },
237+
{ SERIES(SDS2000XP), "SDS2104X Plus", { 1, 1000000000 }, 4, TRUE, 16 },
238+
{ SERIES(SDS2000XP), "SDS2204X Plus", { 1, 1000000000 }, 4, TRUE, 16 },
239+
{ SERIES(SDS2000XP), "SDS2354X Plus", { 1, 1000000000 }, 4, TRUE, 16 },
240+
{ SERIES(SDS2000XP), "SDS2504X Plus", { 1, 1000000000 }, 4, TRUE, 16 },
241+
{ SERIES(SDS2000XHD), "SDS2104X HD", { 1, 1000000000 }, 4, TRUE, 16 },
242+
{ SERIES(SDS2000XHD), "SDS2204X HD", { 1, 1000000000 }, 4, TRUE, 16 },
243+
{ SERIES(SDS2000XHD), "SDS2354X HD", { 1, 1000000000 }, 4, TRUE, 16 },
244+
{ SERIES(SDS2000XHD), "SDS2504X HD", { 1, 1000000000 }, 4, TRUE, 16 },
230245
};
231246

232247
static struct sr_dev_driver siglent_sds_driver_info;
@@ -770,6 +785,7 @@ static int config_list(uint32_t key, GVariant **data,
770785
break;
771786
case SPO_MODEL:
772787
case ESERIES:
788+
case E11:
773789
*data = g_variant_new_strv(ARRAY_AND_SIZE(data_sources));
774790
break;
775791
}
@@ -860,7 +876,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
860876
siglent_sds_get_dev_cfg_horizontal(sdi);
861877
switch (devc->model->series->protocol) {
862878
case SPO_MODEL:
863-
if (siglent_sds_config_set(sdi, "WFSU SP,0,TYPE,1") != SR_OK)
879+
case E11:
880+
if (siglent_sds_config_set(sdi, "WFSU SP,0,NP,0,FP,0") != SR_OK)
864881
return SR_ERR;
865882
if (devc->average_enabled) {
866883
if (siglent_sds_config_set(sdi, "ACQW AVERAGE,%i", devc->average_samples) != SR_OK)
@@ -881,7 +898,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
881898
break;
882899
}
883900

884-
sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 7000,
901+
int tiemout = (devc->model->series->protocol == E11) ? 50 : 7000;
902+
sr_scpi_source_add(sdi->session, scpi, G_IO_IN, tiemout,
885903
siglent_sds_receive, (void *) sdi);
886904

887905
std_session_send_df_header(sdi);

0 commit comments

Comments
 (0)