RIGOL Technologies

Welcome, Guest Login

Support Center

How do I format the data returned from a DS1000E/D series scope?

Last Updated: Dec 29, 2015 04:41PM PST
DS1000E/D Waveform Data Formatting Guide

 The DS1052E/D series of Oscillscopes are capable of returning a number of different sizes of data sets.
• Displayed data is 600 points
• In Stop mode, Normal Acquisition you can return 8k, 16k, 512k, or 1M points depending on how the scope is configured.

In this document, we are going to describe how to format the returned data for each case.

The returned data is formatted as unsigned decimal bytes. In order to interpret the data, we put together the following guide to make it easy to covert the unsigned bytes to ASCII characters. After the conversion, you can then view and manipulate the data in the more traditional format of Volts vs. Time format.

Command Strings are enclosed in quotes “” and comments are denoted by '/'.

For 600 points: While the scope is in run mode, which is indicated by a green LED lighting the Stop/Run button, the scope will only return 610 data points that represent the displayed data on the scope LCD.

NOTE: The first iteration of a data query, or request, performed in stop mode, indicated by a red Run/Stop button will also return 610 data points. 

Step 1: Retrieve scope settings Some setup information is used in the data conversion later. Therefore, we must query the scope to get the proper parameters.
• “:TIM:SCAL?” /Return current time/division setting = <Time_Div>
• “:CHAN1:SCAL?” /Return Channel 1 scale = <Volts_Div>
                               /Alternately, you can replace CHAN1 with CHAN2, if that is the channel of interest.

• “:CHAN1:OFFS?” /Return Channel vertical offset = <Vert_Offset>
                              /Alternately, you can replace CHAN1 with CHAN2, if /that is the channel of interest.

• “:TIM:OFFS?” /Return current trigger offset = <Time_Offset>

Step 2: Retrieve data and convert

• “:WAV:DATA? CHAN1” /Return data. You will need to read the data /string into your program.
• Convert the string to a byte array
• Remove the first 10 data points from the raw data. These contain unused header information. There should be 600 points remaining.

NOTE: When read as unsigned decimals, each byte should have a value of between 15 and 240. The top of the LCD display of the scope represents byte value 25 and the bottom is 225. 

Step 3: Convert Amplitude (Volts) : For each point in the byte array, we will need to perform a mathematical manipulation. To do so, you will need the following variables:
• <Volts_Div>  : Returned time/div value from scope
• <Raw_Byte>: Raw byte from array
• <Vert_Offset>  : Returned Vertical offset value from scope

For each point, to get the amplitude (A) of the waveform in volts (V):

A(V) = [(240 -<Raw_Byte> ) * (<Volts_Div> / 25) - [(<Vert_Offset> + <Volts_Div> * 4.6)]] 

Step 4: Convert Time (s) : For each point in the byte array, we will need to perform a mathematical manipulation. To do so, you will need the following variables:
• <Time_Offset>: Returned Time offset value from scope
• <Time_Div>:: Returned time/div value from scope
• <PT_Num>: The index of the byte array value of interest. There should be 600 points after removing the 10 point header.

To get time in seconds, for each point:

T(s) = (<PT_Num> - 1) * ( <Time_Div> / 50) - [(<Time_Div> * 6) - <Time_Offset> ]

Finally, you can then store or graph the converted data.


For data sets >600 points:

When the scope is in stop mode, which is indicated by a red LED lighting the Stop/Run button, the scope will return 610 data points the first query. Subsequent queries will return data sets of 8k, 16k, 512k, or 1M points depending on the configuration.

NOTE: The first iteration of a data query, or request, performed in stop mode, indicated by a red Run/Stop button, will also return 610 data points. You can simply write these values to an unused storage location or delete them. 

Step 1: Retrieve scope settings
Some setup information is used in the data conversion later. Therefore, we must query the scope to get the proper parameters.

• “:CHAN1:SCAL?” /Return Channel 1 scale = <Volts_Div>
                 /Alternately, you can replace CHAN1 with CHAN2, if /that is the channel of interest.

• “:CHAN1:OFFS?” /Return Channel vertical offset = <Vert_Offset>
                /Alternately, you can replace CHAN1 with CHAN2, if /that is the channel of interest.

• “:TIM:OFFS?” /Return current trigger offset = <Time_Offset>

• “:ACQ:SAMP?” /Return acquisition sample rate = <Samp_Rate>


Step 2: Retrieve data and convert
• “:WAV:DATA? CHAN1” /Return data. You will need to read the data /string into your program.

• Convert the string to a byte array
• Remove the first 10 data points from the raw data. These contain unused header information.

NOTE: When read as unsigned decimals, each byte should have a value of between 15 and 240. The top of the LCD display of the scope represents byte value 25 and the bottom is 225.

Step 3: Convert Amplitude (Volts) :
For each point in the byte array, we will need to perform a mathematical manipulation. To do so, you will need the following variables:
• <Volts_Div>  : Returned time/div value from scope 
• <Raw_Byte>: Raw byte from array 
• <Vert_Offset>  : Returned Vertical offset value from scope 

For each point, to get the amplitude (A) of the waveform in volts (V):

A(V) = [(240 -<Raw_Byte> ) * (<Volts_Div> / 25) - [(<Vert_Offset> + <Volts_Div> * 4.6)]] 


Step 4: Convert Time (s) :
For each point in the byte array, we will need to perform a mathematical manipulation. To do so, you will need the following variables:
•<Time_Offset>  : Returned Time offset value from scope
•<Samp_Rate>  : Returned sample rate value from scope
•<Points>  : The total number of data points returned from the data query.

To get time in seconds, for each point:
T(s) = <Time_Offset> -[ ( <Points>  - 10) / (1 / (2*<Samp_Rate> )]

Finally, you can then store or graph the converted data.
Login above for personalized content

RIGOL USA Web Site

f14c465fd642ac49fa5a4bd437615e15@rigol.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete