CSV to PNG converter for oscilloscope data
A web-based csv-file to png-image converter, designed for oscilloscope data output.
A while back I was trying to reverse-engineer a data protocol between two circuits in my Lexmark printer because I was trying to make the printer print with cheaper ink from other companies (which doesn't cost more per volume than blood, you know). My main problem was in saving the data I had captured: Making screenshots of the data 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 sucked. The only output possibility left (for the softare I had) was to output the data in a "comma seperated values" (.csv) format. But it was plain text, not a nice graph which could be easily read and analysed. So I took it as a challenge to program a web-based data visualiser 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 application. You can define height and width of your image (or let the software determine that for you), aswell as select whether you want the displayed channels to overlay or to be seperated. With the data packets from my printer, which were transferred over two wires, I selected the "seperate" option so that I could better analyse 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 (e.g. a 10000x1250 large image). So please try it out and tell me what you think of it. You can even view the source code on it's own Github repository! How must the .csv file look like?
If you are using a .csv file exported from a Rigol DS1052E, then you shouldn't care about the file structure, it will work. Data from oscilloscopes of the same device family should work as well. 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 other columns contain the channel values
- Empty lines don't matter, they are ignored
- It doesn't matter whether or not a data row ends with a comma
Furthermore, the application supports up to 8 columns, which should be more than enough. If you're unsure whether your .csv file is compatible, go ahead and try it out! You won't lose anything! Try out different option settings to see what fits best for your dataset.