Rigol DS2072a File Exporting - Page 1
Forum section: electronics / beginners

author: histind
author_rank: Newbie
timestamp: March 26, 2014, 01:24:37 am
content: I am trying to export a .csv file from this scope, but the horizontal values are just numbered sequentially as opposed to having a timestamp. Other scopes that I've used (namely Tektronix) actually have a time value in scientific notation. Do the sequence numbers convert to timings?

author: histind
author_rank: Newbie
timestamp: March 26, 2014, 04:07:02 am
content: ...just noticed the increment value at the head of the file. So, if I want to parse the file and grab an interval with length in seconds I would take the number of samples in the interval and multiply by the increment value. Sounds right, but could someone confirm? Thanks!

author: miguelvp
author_rank: Super Contributor
timestamp: March 26, 2014, 05:03:31 am
content: Would love to, but for the life of me I can't find a thumb drive anywhereAnd mine is a DS2072 not sure if it will make a difference

author: histind
author_rank: Newbie
timestamp: March 27, 2014, 01:46:34 am
content: Here's an excerpt from a test file, renamed to a .txt file.

author: miguelvp
author_rank: Super Contributor
timestamp: March 27, 2014, 02:46:43 am
content: Quote from: histind on March 27, 2014, 01:46:34 amWhat I get from that file is.You were measuring Volts over time in Channel 1.time starts at -1.4000000209 (I bet the end is round off)increment of 2ms (plus some round off error.total time 2.8 seconds capture60ms at 5.04V to 5.28V248ms at -0.16V to 0.08V252ms at 5.04V to 5.28V250ms at -0.16V to 0.08V254ms at 5.04V to 5.28V...flipping back and forth from 5V to 0V every 250ms more or less.So any index in the file times the step + the beginning it will tell you the time of that entry.The value after will give you the voltage as the header describes CH1 to be in Volts.Edit: I also see spikes of -2v when going from 5 to 0 towards the end, the last one is of -2.56Valso some overshoots when going from 0 to 5. Small ones like reaching 5.3VAnd a lot of noise while at 5 or 0 or a waveform of 4ms period during the whole thing about 0.24V ppIs that what you captured?

author: miguelvp
author_rank: Super Contributor
timestamp: March 27, 2014, 04:06:50 am
content: Quote from: histind on March 26, 2014, 04:07:02 amI guess to put it more plainly that above.the entries:Code:0,5.040000e+00,1,5.280000e+00,2,5.040000e+00,3,5.280000e+00,4,5.040000e+00,5,5.280000e+00,6,5.040000e+00,7,5.280000e+00,8,5.040000e+00,9,5.280000e+00,10,5.040000e+00,11,5.280000e+00,...is a time index followed by the value.The header:Code:X,CH1,Start,Increment,Sequence,Volt,-1.4000000209e000,2.0000000950e-003,is the type of data, what the value after the index is (Volts)Then the Start of the capture (at index 0)and the step increment between indices.So if we take the following piece:Code:400,-8.000000e-02,401,1.600000e-01,402,8.000000e-02,403,-8.000000e-02,404,-8.000000e-02,405,5.280000e+00,406,5.280000e+00,407,5.040000e+00,408,5.040000e+00,409,5.280000e+00,400 is the time index, multiplied by 0.0020000000950 (2.0000000950e-003 or 2.0000000950*10^-3)It will give you 0.800000038.Add it to start value -1.4000000209and the time at index 400 is -0.5999999829 seconds (0 will be the center of the scope where you triggered so this is left of the center)No you have 10 samples (400 to 409) so the total duration is 10 * step increment 0.0020000000950 = 0.020000000950 (around 20 milliseconds) and the values after the index indicate the voltage because the header says that's what channel 1 was capturing.-8.000000e-02 is -8.000000*10^-02 = -0.0800000 Volts5.280000e+00 is 5.280000*10^0, since 10^0 is 1 then it's 5.2800000 Volts1.600000e-01 is 1.600000*10^-01 = 0.16000000 VoltsIn C you can parse with sscanf from a buffer holding the linei.e.int index, numScanned;float voltagefloat;numScanned = sscanf(buff,"%d,%f,"&index, &voltagefloat);sscanf will interpret the exponential notation and do the right thing.for doubles use %lf if you think the data has that much resolution (but it doesn't look like it)the returned value will tell you how many values was able to scan, so it should return 2 if it succeeded.

author: miguelvp
author_rank: Super Contributor
timestamp: April 02, 2014, 12:59:55 pm
content: I finally found a thumb drive so I used the built in test signal to do a capture both on cvs and as an image.Here is my analysis.Code:X is SequenceCH1 is VoltsStart -3.5000001662e-003 (-0.003500s or -3.5ms)Increment 5.0000003284e-006 (0.000005s or 5us)Samples Num Inc Duration Volts[ 0- 100] 101 * 5us = 505us ~0V[ 101- 200] 100 * 5us = 500us ~3V[ 201- 300] 100 * 5us = 500us ~0V[ 301- 400] 100 * 5us = 500us ~3V[ 401- 500] 100 * 5us = 500us ~0V[ 501- 600] 100 * 5us = 500us ~3V[ 601- 700] 100 * 5us = 500us ~0V[ 701- 800] 100 * 5us = 500us ~3V[ 801- 900] 100 * 5us = 500us ~0V[ 901-1000] 100 * 5us = 500us ~3V[1001-1100] 100 * 5us = 500us ~0V[1101-1200] 100 * 5us = 500us ~3V[1201-1300] 100 * 5us = 500us ~0V[1301-1399] 99 * 5us = 495us ~3V1400 * 5us = 7000us or 7ms total durationTrigger at 0.0msStart at -3.5msEnd at 3.5msFunny that the image shows the signal at -3.5ms to be 3V if you look carefully.And I don't know why it shows 505us for the 1st period.Maybe there is a bug and the first signal at entry 0 was supposed to be 3V?I used "displayed" for the capturing range.Edit: obviously I forgot to change the input to x10 so the screen capture should say 500mv for channel 1 on the lower left and the entries on the cvs file shouldn't say 3.000000e-01, should be 3.000000e+00.While trying to save the files I did hit the default by mistake since the back menu button changes to default (bad location) so I guess I did hit it, so on my final test the CH1 input as set to X1And yes, I might need to calibrate my probe but I didn't let it warm up, and CH1 takes a while to settle down.