Converting Rigol DS1102D Logic Analyzer .csv files to OLS data file format using Linux

How to convert .csv files exported from a Rigol DS1102D MSO to OLS data file format.


So I own a Rigol DS1102D 100mhz MSO which has two-channels of analog and 16 channels of logic analysis through the active logic head LH1116.

It’s capable for recording 1 million records at 100mhz, which is very respectable for most of the hobby projects that I work on.  This is probably the fourth or fifth product I have capable of doing logic analysis, and most have their strengths and weaknesses.  This one is a small standalone unit that doesn’t require a PC, or external keyboard/mouse/monitor.  It can display all 16 channels at once on the LCD, and is great for making quick measurements.

Ultrascope, the included PC software, is just lacking in even the basic most features.  While it’s neat that it replicates the scope’s interface directly, when you have a PC a much better interface is possible.

Rigol DS1102D Exporting….

Using a usb flash drive, you can transfer WFM (waveform) files, .CSVs, bitmaps of a screenshot of the LCD, and so on.

  1. Click Run/Stop once you’ve captured the required data.
  2. Insert a USB stick.
  3. Click Storage under the Menu group.
  4. Pick the top gray soft-button and make sure that CSV is selected.
  5. Make sure the LA Data Type is set to Hex (instead of binary or Decimal)
  6. Pick the bottom gray soft-button for the second screen of Storage options.
  7. Select External.
  8. Specify a filename, and then click ok.
  9. After it’s finished, transfer the USB stick to a Linux PC.

Download the OLS client for your platform. I tested this on a Windows 8 machine — I would imagine this should work fine for the other platforms.

Converting the file

  1. Execute the following command which basically just rearranges the data into a usable format:
  2. cat NewFile0.csv | cut -d , -f 2,3 -s | nawk '{print $0"@"FNR}' | tr -d '\r' | tr -d ',' | sed -e "s/ 0/00/" > NewFile0.ols
  3. Then, remove the existing top two lines: the header row with D15,D14,D13, etc, and the “Second,” line.
  4. Add the following four lines to the beginning of the file:
    ;Rate: 100000000
    ;Channels: 16
  5. The file is now ready to be loaded.  Launch OLS and select Open. (not open project!), and select the file.


About the author


Amateur Electronics Design Engineer and Hacker