@@ -105,6 +105,7 @@ static const uint64_t timebases[][2] = {
105105
106106static const uint64_t vdivs [][2 ] = {
107107 /* microvolts */
108+ { 200 , 1000000 },
108109 { 500 , 1000000 },
109110 /* millivolts */
110111 { 1 , 1000 },
@@ -185,6 +186,8 @@ enum series {
185186 DS4000 ,
186187 MSO5000 ,
187188 MSO7000A ,
189+ DHO800 ,
190+ DHO900 ,
188191};
189192
190193/* short name, full name */
@@ -217,6 +220,10 @@ static const struct rigol_ds_series supported_series[] = {
217220 {1000 , 1 }, {500 , 1000000 }, 10 , 1000 , 0 },
218221 [MSO7000A ] = {VENDOR (AGILENT ), "MSO7000A" , PROTOCOL_V4 , FORMAT_IEEE488_2 ,
219222 {50 , 1 }, {2 , 1000 }, 10 , 1000 , 8000000 },
223+ [DHO800 ] = {VENDOR (RIGOL ), "DHO800" , PROTOCOL_V6 , FORMAT_IEEE488_2 ,
224+ {500 , 1 }, {500 , 1000000 }, 10 , 1000 , 0 },
225+ [DHO900 ] = {VENDOR (RIGOL ), "DHO900" , PROTOCOL_V6 , FORMAT_IEEE488_2 ,
226+ {500 , 1 }, {200 , 1000000 }, 10 , 1000 , 0 },
220227};
221228
222229#define SERIES (x ) &supported_series[x]
@@ -291,6 +298,14 @@ static const struct rigol_ds_model supported_models[] = {
291298 {SERIES (MSO5000 ), "MSO5354" , {1 , 1000000000 }, CH_INFO (4 , true), std_cmd },
292299 /* TODO: Digital channels are not yet supported on MSO7000A. */
293300 {SERIES (MSO7000A ), "MSO7034A" , {2 , 1000000000 }, CH_INFO (4 , false), mso7000a_cmd },
301+ {SERIES (DHO800 ), "DHO802" , {5 , 1000000000 }, CH_INFO (2 , false), std_cmd },
302+ {SERIES (DHO800 ), "DHO804" , {5 , 1000000000 }, CH_INFO (4 , false), std_cmd },
303+ {SERIES (DHO800 ), "DHO812" , {5 , 1000000000 }, CH_INFO (2 , false), std_cmd },
304+ {SERIES (DHO800 ), "DHO814" , {5 , 1000000000 }, CH_INFO (4 , false), std_cmd },
305+ {SERIES (DHO900 ), "DHO914" , {2 , 1000000000 }, CH_INFO (4 , true), std_cmd },
306+ {SERIES (DHO900 ), "DHO914S" , {2 , 1000000000 }, CH_INFO (4 , true), std_cmd },
307+ {SERIES (DHO900 ), "DHO924" , {2 , 1000000000 }, CH_INFO (4 , true), std_cmd },
308+ {SERIES (DHO900 ), "DHO924S" , {2 , 1000000000 }, CH_INFO (4 , true), std_cmd },
294309};
295310
296311static struct sr_dev_driver rigol_ds_driver_info ;
@@ -913,20 +928,45 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
913928 some_digital = TRUE;
914929 /* Turn on LA module if currently off. */
915930 if (!devc -> la_enabled ) {
916- if (rigol_ds_config_set (sdi , protocol >= PROTOCOL_V3 ?
917- ":LA:STAT ON" : ":LA:DISP ON" ) != SR_OK )
931+ switch (protocol ) {
932+ case PROTOCOL_V1 :
933+ case PROTOCOL_V2 :
934+ cmd = ":LA:DISP ON" ;
935+ break ;
936+ case PROTOCOL_V3 :
937+ case PROTOCOL_V4 :
938+ case PROTOCOL_V5 :
939+ cmd = ":LA:STAT ON" ;
940+ break ;
941+ case PROTOCOL_V6 :
942+ default :
943+ cmd = ":LA:ENAB ON" ;
944+ break ;
945+ }
946+ if (rigol_ds_config_set (sdi , cmd ) != SR_OK )
918947 return SR_ERR ;
919948 devc -> la_enabled = TRUE;
920949 }
921950 }
922951 if (ch -> enabled != devc -> digital_channels [ch -> index ]) {
923952 /* Enabled channel is currently disabled, or vice versa. */
924- if (protocol >= PROTOCOL_V5 )
925- cmd = ":LA:DISP D%d,%s" ;
926- else if (protocol >= PROTOCOL_V3 )
927- cmd = ":LA:DIG%d:DISP %s" ;
928- else
929- cmd = ":DIG%d:TURN %s" ;
953+ switch (protocol ) {
954+ case PROTOCOL_V1 :
955+ case PROTOCOL_V2 :
956+ cmd = ":DIG%d:TURN %s" ;
957+ break ;
958+ case PROTOCOL_V3 :
959+ case PROTOCOL_V4 :
960+ cmd = ":LA:DIG%d:DISP %s" ;
961+ break ;
962+ case PROTOCOL_V5 :
963+ cmd = ":LA:DISP D%d,%s" ;
964+ break ;
965+ case PROTOCOL_V6 :
966+ default :
967+ cmd = ":LA:DIG:ENAB D%d,%s" ;
968+ break ;
969+ }
930970
931971 if (rigol_ds_config_set (sdi , cmd , ch -> index ,
932972 ch -> enabled ? "ON" : "OFF" ) != SR_OK )
@@ -940,10 +980,29 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
940980 return SR_ERR ;
941981
942982 /* Turn off LA module if on and no digital channels selected. */
943- if (devc -> la_enabled && !some_digital )
944- if (rigol_ds_config_set (sdi ,
945- devc -> model -> series -> protocol >= PROTOCOL_V3 ?
946- ":LA:STAT OFF" : ":LA:DISP OFF" ) != SR_OK )
983+ if (devc -> la_enabled && !some_digital ) {
984+ switch (protocol ) {
985+ case PROTOCOL_V1 :
986+ case PROTOCOL_V2 :
987+ cmd = ":LA:DISP OFF" ;
988+ break ;
989+ case PROTOCOL_V3 :
990+ case PROTOCOL_V4 :
991+ case PROTOCOL_V5 :
992+ cmd = ":LA:STAT OFF" ;
993+ break ;
994+ case PROTOCOL_V6 :
995+ default :
996+ cmd = ":LA:ENAB OFF" ;
997+ break ;
998+ }
999+ if (rigol_ds_config_set (sdi , cmd ) != SR_OK )
1000+ return SR_ERR ;
1001+ }
1002+
1003+ /* For DHO scopes, trigger must be in stop mode to start memory or segmented acquisition */
1004+ if ((protocol == PROTOCOL_V6 )&& ((devc -> data_source == DATA_SOURCE_SEGMENTED )|| (devc -> data_source == DATA_SOURCE_MEMORY )))
1005+ if (rigol_ds_config_set (sdi , ":STOP" ) != SR_OK )
9471006 return SR_ERR ;
9481007
9491008 /* Set memory mode. */
@@ -969,10 +1028,28 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
9691028 devc -> num_frames_segmented = frames ;
9701029 break ;
9711030 }
1031+ case PROTOCOL_V6 :
1032+ /* DHO scopes need to be in UltraAcquire mode for segmented acquisoton */
1033+ /* This command is not working as for firmware version v00.01.02.00.02 of 2023/12/28
1034+ the scope has to be put manually in UltraAcquire mode for segmented acquisition to work */
1035+ //if (rigol_ds_config_set(sdi, ":ACQ:TYPE ULTR") != SR_OK)
1036+ // return SR_ERR; */
1037+
1038+ int frames = 0 ;
1039+ //if (sr_scpi_get_int(sdi->conn, ":REC:FRAM?", &frames) != SR_OK)
1040+ if (sr_scpi_get_int (sdi -> conn , ":ACQ:ULTR:MAXF?" , & frames ) != SR_OK )
1041+ return SR_ERR ;
1042+ if (frames <= 0 ) {
1043+ sr_err ("No segmented data available" );
1044+ return SR_ERR ;
1045+ }
1046+ devc -> num_frames_segmented = frames ;
1047+ /* Continue with REC:CURR command */
1048+ // fall through
9721049 case PROTOCOL_V5 :
9731050 /* The frame limit has to be read on the fly, just set up
9741051 * reading of the first frame */
975- if (rigol_ds_config_set (sdi , "REC:CURR 1" ) != SR_OK )
1052+ if (rigol_ds_config_set (sdi , ": REC:CURR 1" ) != SR_OK )
9761053 return SR_ERR ;
9771054 break ;
9781055 default :
@@ -984,7 +1061,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
9841061 devc -> analog_frame_size = analog_frame_size (sdi );
9851062 devc -> digital_frame_size = digital_frame_size (sdi );
9861063
987- switch (devc -> model -> series -> protocol ) {
1064+ switch (protocol ) {
9881065 case PROTOCOL_V2 :
9891066 if (rigol_ds_config_set (sdi , ":ACQ:MEMD LONG" ) != SR_OK )
9901067 return SR_ERR ;
@@ -1021,7 +1098,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
10211098 (devc -> timebase * devc -> model -> series -> num_horizontal_divs );
10221099 } else {
10231100 float xinc ;
1024- if (devc -> model -> series -> protocol < PROTOCOL_V3 ) {
1101+ if (protocol < PROTOCOL_V3 ) {
10251102 sr_err ("Cannot get samplerate (below V3)." );
10261103 return SR_ERR ;
10271104 }
@@ -1037,8 +1114,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
10371114 devc -> sample_rate = 1. / xinc ;
10381115 }
10391116
1040- if (rigol_ds_capture_start (sdi ) != SR_OK )
1041- return SR_ERR ;
1117+ ret = rigol_ds_capture_start (sdi );
1118+ if (ret != SR_OK )
1119+ return ret ;
10421120
10431121 /* Start of first frame. */
10441122 std_session_send_df_frame_begin (sdi );
0 commit comments