- Chainsaw Bike
- STM32F429 LCD Example
- My PHP Content Managing System
- PHP image handler
- Flyback-transformer driver
- Atari Punk Console
- Teensy - ESP8266 - Interface
- Charging station
- 4-bit Adder
A .csv to .png converter and visualiser for oscilloscope dataJun 2015
A while back I was examining a data protocol between two circuits in my Lexmark printer;
my goal was to make the printer print with cheaper ink from other companies (Brand toner cartridges cost you an arm and a leg).
My main problem was in saving the data I had captured: Making screenshots of the data on the oscilloscope was tedious, as I would have to make more than 10 screenshots of different portions of data and then stitch the shots back together in an image-editing program. It was hardly good enough. The only output possibility left (for the software I had) was to output the data in a "comma separated values" (.csv) format. But it was plain text, not a nice graph which could be easily read.
So I took it as a challenge to program a web-based data visualizer in PHP, which could convert the .csv file into a .png file.
I found it important to add a small level of configurability into my app. You can define height and width of your image (or let the software determine that for you), as well as select whether you want the displayed channels to overlay or to be separated. With the data packets from my printer which were transferred over two wires, I selected the "separate" option so that I could better analyze each channel on its own.
The application has one limitation which is the size of the image. I say this even though it shouldn't be an issue - the maximum image area is 12.5 million pixels (an example: 10.000px X 1.250px large).
Structure of the input CSV file
If you are using a .csv file exported from a Rigol DS1052E, then you shouldn't care about the file structure, I used the same model. If not and you want to see if your .csv file is compatible, check the following points:
- The first row declares the names of the columns
- The second row defines the units of the columns
- The first column contains the time values
- All following columns contain the channel values
- Empty lines don't matter; they are ignored
- It doesn't matter if a data row ends with a comma or not
Furthermore, the application supports up to 8 columns, which should be more than enough. If you're unsure if your .csv file is compatible, go ahead and try it out! Try out different option settings to see what fits best for your dataset.
The PHP code is open source and has its own Github repository .