How to Extract Data from the Binary File of SDS2000X, SDS1000X, and SDS1000X-E
October 25, 2017
Table 1 Format of the Binary File
Address | Parameter | Description |
0x00-0x03 | wave_length | Reserved |
0x04-0x07 | mso_wave_length | digital channels wave length |
0x10-0x13 | mso_ch_open_num | Total enabled digital channels
32-bit signed integer, little endian. |
0x14 | mso_ch_open_state[0] | on/off status of digital channel 0 (D0), 1 – ON, 0 – OFF
8-bit unsigned integer. |
0x15 | mso_ch_open_state[1] | on/off status of digital channel 1 (D1) |
0x16 | mso_ch_open_state[2] | on/off status of digital channel 2 (D2) |
0x17 | mso_ch_open_state[3] | on/off status of digital channel 3 (D3) |
0x18 | mso_ch_open_state[4] | on/off status of digital channel 4 (D4) |
0x19 | mso_ch_open_state[5] | on/off status of digital channel 5 (D5) |
0x1a | mso_ch_open_state[6] | on/off status of digital channel 6 (D6) |
0x1b | mso_ch_open_state[7] | on/off status of digital channel 7 (D7) |
0x1c | mso_ch_open_state[8] | on/off status of digital channel 8 (D8) |
0x1d | mso_ch_open_state[9] | on/off status of digital channel 9 (D9) |
0x1e | mso_ch_open_state[10] | on/off status of digital channel 10 (D10) |
0x1f | mso_ch_open_state[11] | on/off status of digital channel 11 (D11) |
0x20 | mso_ch_open_state[12] | on/off status of digital channel 12 (D12) |
0x21 | mso_ch_open_state[13] | on/off status of digital channel 13 (D13) |
0x22 | mso_ch_open_state[14] | on/off status of digital channel 14 (D14) |
0x23 | mso_ch_open_state[15] | on/off status of digital channel 15 (D15) |
0xbc-0xbf | ch1_volt_div_val | V/div value of CH1, in units of mV. Such as 2.48 mV/div.
32-bit float point, little endian. |
0xc0-0xc3 | ch2_volt_div_val | V/div value of CH2, in units of mV. Such as 2.48 mV/div.
32-bit float point, little endian. |
0xc4-0xc7 | ch3_volt_div_val | V/div value of CH3, in units of mV. Such as 2.48 mV/div.
32-bit float point, little endian. |
0xc8-0xcb | ch4_volt_div_val | V/div value of CH4, in units of mV. Such as 2.48 mV/div.
32-bit float point, little endian. |
0xdc-0xdf | ch1_vert_offset | Offset value of CH1, with the unit of pixel. Refer to “Calculate the Vertical Offset” to get the actual offset voltage
32-bit signed integer, little endian. |
0xe0-0xe3 | ch2_vert_offset | Offset value of CH2 |
0xe4-0xe7 | ch3_vert_offset | Offset value of CH3 |
0xe8-0xeb | ch4_vert_offset | Offset value of CH4 |
0xf0-0xf3 | ch1_volt_div | The coarse V/div index of CH1. Refer to Table 3 for the details.
32-bit signed integer, little endian. |
0xf4-0xf7 | ch2_volt_div | The coarse V/div index of CH2. |
0xf8-0xfb | ch3_volt_div | The coarse V/div index of CH3. |
0xfc-0xff | ch4_volt_div | The coarse V/div index of CH4. |
0x100-0x103 | ch1_on | on/off status of CH1, 1 – ON, 0 – OFF
32-bit signed integer, little endian. |
0x104-0x107 | ch2_on | on/off status of CH2 |
0x108-0x10b | ch3_on | on/off status of CH3 |
0x10c-0x10f | ch4_on | on/off status of CH4 |
0x248-0x24b | time_div | T/div index. Refer to Table 2 for the details
32-bit signed integer, little endian. |
0x250-0x253 | time_delay | Time delay (Trigger delay) value, in units of pixel. Refer to “Calculate the Time Delay” to get the actual time delay
32-bit signed integer, little endian. |
0x1470-end | data | Data. Analog data first, and then digital data. Only data of the enabled channel(s) are stored to the file
8-bit unsigned integer for analog data 1-bit binary integer for digital data |
Table 2 T/div Table
Index | SDS2000X | SDS1000X |
0 | 1 ns/div | |
1 | 2 ns/div | 2 ns/div |
2 | 5 ns/div | 5 ns/div |
3 | 10 ns/div | 10 ns/div |
4 | 20 ns/div | 20 ns/div |
5 | 50 ns/div | 50 ns/div |
6 | 100 ns/div | 100 ns/div |
7 | 200 ns/div | 200 ns/div |
8 | 500 ns/div | 500 ns/div |
9 | 1 us/div | 1 us/div |
10 | 2 us/div | 2 us/div |
11 | 5 us/div | 5 us/div |
12 | 10 us/div | 10 us/div |
13 | 20 us/div | 20 us/div |
14 | 50 us/div | 50 us/div |
15 | 100 us/div | 100 us/div |
16 | 200 us/div | 200 us/div |
17 | 500 us/div | 500 us/div |
18 | 1 ms/div | 1 ms/div |
19 | 2 ms/div | 2 ms/div |
20 | 5 ms/div | 5 ms/div |
21 | 10 ms/div | 10 ms/div |
22 | 20 ms/div | 20 ms/div |
23 | 50 ms/div | 50 ms/div |
24 | 100 ms/div | 100 ms/div |
25 | 200 ms/div | 200 ms/div |
26 | 500 ms/div | 500 ms/div |
27 | 1 s/div | 1 s/div |
28 | 2 s/div | 2 s/div |
29 | 5 s/div | 5 s/div |
30 | 10 s/div | 10 s/div |
31 | 20 s/div | 20 s/div |
32 | 50 s/div | 50 s/div |
Table 3 V/div Table
Index | SDS2000X | SDS1000X |
0 | 1 mV/div | 500uV/div |
1 | 2 mV/div | 1 mV/div |
2 | 5 mV/div | 2 mV/div |
3 | 10 mV/div | 5 mV/div |
4 | 20 mV/div | 10 mV/div |
5 | 50 mV/div | 20 mV/div |
6 | 100 mV/div | 50 mV/div |
7 | 200 mV/div | 100 mV/div |
8 | 500 mV/div | 200 mV/div |
9 | 1 V/div | 500 mV/div |
10 | 2 V/div | 1 V/div |
11 | 5 V/div | 2 V/div |
12 | 10 V/div | 5 V/div |
13 | 10 V/div |
Calculate the Sample Rate
sample_rate = (wave_length)/(hori_div_num*time_div_val)
[example]
hori_div_num = 14 # total horizontal divisions, on SDS2000X is 14
wave_length = 700 pts # length of each frame. Could be got by calculating the length of the data section in the file
time_div_val = 50 ns/div # use the T/div index got from the binary file to search Table 2
So:
sample_rate = 700/(14*50e-9) = 1e9(Sa/s)
Calculate the Vertical Offset
vert_offset = (ch_vert_offset – 220)*( ch_volt_div_val/pixels_per_div)
[example]
pixels_per_div = 50 # total display pixels in a vertical division, on SDS2000X is 50
ch_vert_offset = 270 # offset value, with the unit of pixel, got from the binary file
ch_volt_div_val = 50 mV/div # v/div value, got from the binary file
So:
vert_offset = (270 – 220)*(50 mV/50) = 50 mV;
Calculate the Time Delay
hori_offset_time = (time_offset – 349)*( time_div_val /pixels_per_div)
[example]
pixels_per_div = 50 # total display pixels in a horizontal division, on SDS2000X is 50
time_offset = 299 # time delay value, with the unit of pixel, got from the binary file
time_div_val = 50 ns # use the T/div index got from the binary file to search Table 2
So:
hori_offset_time = (299 – 349)*(50 ns/50) = -50ns
Convert the Data to Voltage
voltage = (data-128) * ch_volt_div_val /1000/code_per_div + ch_vert_offset
[example]
code_per_div = 50 # total data code in a horizontal division, on SDS2000X is 25
data = 194 # got from the binary file
ch_volt_div_val = 5000 mV/div # V/div, in units of mV
ch_vert_offset = -7.7 V # vertical offset
So:
voltage = (194-128) * 5000/1000/25+(-7.7) = 5.5 V