VirtualBench

cancel
Showing results for 
Search instead for 
Did you mean: 

Export virtualbench data to excel file - meaning of fields - import to matlab

How can I take the csv file generated by the export command from virtualbench directly into matlab to analyze oscilloscope data? What is the meaning of the different fields in the exported CSV file? Foreach channel there are high and low values. What does that mean as well. Do we average them?

Thanks

Harry

0 Kudos
Message 1 of 4
(6,802 Views)

The high and low values are from acquiring in Peak Detect mode.

 

WilliamEarle explains further in this post: Question on Exporting Data from Virtualbench

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 2 of 4
(6,796 Views)

Yes, i got that one figured out. Is there a simple way to just get the data into matlab, without all of the setup fields that seem to be in the csv as well? Are all of the other fields always in the same place in the csv, so we can just omit them?

Thanks

Harry

 

0 Kudos
Message 3 of 4
(6,793 Views)

The .csv data exports are optimized for viewing in Excel, not optimized for programmatic scripting. It can be done, but it's does require nontrivial parsing.

 

Fields aren't guaranteed to have a particular absolute position, but they are at predictable relative locations. (For instance, if you have a large number of digital channels configured, that will increase the number of rows that the configuration section occupies, but the data section follows right after. The instruments are also in the same order left-to-right.)

 

If trying to parse out the MSO analog data programmatically, I'd go for a strategy like:

 

  • Walk down rows until you find "Data" in the first column. This will skip over the Configuration sections (no matter how many rows they take up)
  • Walk up one row, then walk right until you find the instrument you want. (Since you're interested in the "MIXED SIGNAL OSCILLOSCOPE", column zero is already the right place.)
  • Walk down two rows, then right until you find "Analog"
  • Walk down one row, then right one column. This is the "Timestamp" column header. Subsequent columns are for each channel, and the number will vary, as you have seen, based on number of enabled channels and sampling mode.
  • You can then walk down processing each row.

 

The Read From Spreadsheet File LabVIEW VI might be useful here to read the whole .csv into a 2D array. I've not used Matlab, so I don't know how you'd accomplish that processing there.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 4 of 4
(6,760 Views)