This fixes bug #1208.
DS2000A,
DSO1000,
DS1000Z,
+ DS4000,
};
/* short name, full name */
{50, 1}, {2, 1000}, 12, 600, 20480},
[DS1000Z] = {VENDOR(RIGOL), "DS1000Z", PROTOCOL_V4, FORMAT_IEEE488_2,
{50, 1}, {1, 1000}, 12, 1200, 12000000},
+ [DS4000] = {VENDOR(RIGOL), "DS4000", PROTOCOL_V4, FORMAT_IEEE488_2,
+ {1000, 1}, {1, 1000}, 14, 1400, 14000},
};
#define SERIES(x) &supported_series[x]
{SERIES(DS1000Z), "MSO1104Z", {5, 1000000000}, CH_INFO(4, true)},
{SERIES(DS1000Z), "MSO1074Z-S", {5, 1000000000}, CH_INFO(4, true)},
{SERIES(DS1000Z), "MSO1104Z-S", {5, 1000000000}, CH_INFO(4, true)},
+ {SERIES(DS4000), "DS4024", {1, 1000000000}, CH_INFO(4, false)},
};
static struct sr_dev_driver rigol_ds_driver_info;
if (devc->model->series->protocol >= PROTOCOL_V3 &&
ch->type == SR_CHANNEL_ANALOG) {
+ /* Vertical increment. */
+ if (sr_scpi_get_float(sdi->conn, ":WAV:YINC?",
+ &devc->vert_inc[ch->index]) != SR_OK)
+ /* Vertical origin. */
+ if (sr_scpi_get_float(sdi->conn, ":WAV:YOR?",
+ &devc->vert_origin[ch->index]) != SR_OK)
+ return SR_ERR;
/* Vertical reference. */
if (sr_scpi_get_int(sdi->conn, ":WAV:YREF?",
&devc->vert_reference[ch->index]) != SR_OK)
return SR_ERR;
+ } else if (ch->type == SR_CHANNEL_ANALOG) {
+ devc->vert_inc[ch->index] = devc->vdiv[ch->index] / 25.6;
}
rigol_ds_set_wait_event(devc, WAIT_BLOCK);
struct sr_analog_meaning meaning;
struct sr_analog_spec spec;
struct sr_datafeed_logic logic;
- double vdiv, offset;
+ double vdiv, offset, origin;
int len, i, vref;
struct sr_channel *ch;
gsize expected_data_bytes;
if (ch->type == SR_CHANNEL_ANALOG) {
vref = devc->vert_reference[ch->index];
- vdiv = devc->vdiv[ch->index] / 25.6;
+ vdiv = devc->vert_inc[ch->index];
+ origin = devc->vert_origin[ch->index];
offset = devc->vert_offset[ch->index];
if (devc->model->series->protocol >= PROTOCOL_V3)
for (i = 0; i < len; i++)
- devc->data[i] = ((int)devc->buffer[i] - vref) * vdiv - offset;
+ devc->data[i] = ((int)devc->buffer[i] - vref - origin) * vdiv;
else
for (i = 0; i < len; i++)
devc->data[i] = (128 - devc->buffer[i]) * vdiv - offset;
float attenuation[MAX_ANALOG_CHANNELS];
float vdiv[MAX_ANALOG_CHANNELS];
int vert_reference[MAX_ANALOG_CHANNELS];
+ float vert_origin[MAX_ANALOG_CHANNELS];
float vert_offset[MAX_ANALOG_CHANNELS];
+ float vert_inc[MAX_ANALOG_CHANNELS];
char *trigger_source;
float horiz_triggerpos;
char *trigger_slope;
static struct usbtmc_blacklist blacklist_remote[] = {
{ 0x1ab1, 0x0588 }, /* Rigol DS1000 series */
{ 0x1ab1, 0x04b0 }, /* Rigol DS2000 series */
+ { 0x1ab1, 0x04b1 }, /* Rigol DS4000 series */
{ 0x0957, 0x0588 }, /* Agilent DSO1000 series (rebadged Rigol DS1000) */
{ 0x0b21, 0xffff }, /* All Yokogawa devices */
{ 0xf4ec, 0xffff }, /* All Siglent SDS devices */