Reading Data from LoggerPro

Starting Up

The following two commands prevent annoying warnings about the use of symbols similar to those used by Mathematica because Mathematica will not let us change their definitions.

Off[General::spell];Off[General::spell1];

Use SetDirectory to choose the directory where your data file is located.

SetDirectory["C:\Documents and Settings\sma\Desktop"];

Read LoggerPro Output Data Files

To read a sequential data file into Mathematica use ReadList. The output files generated by LoggerPro consist of 7 header lines followed by data in two- or three-column format. The first column is the time in seconds; the second column is the voltage data (in volts) for channel 1; and the third column is the voltage data for channel 2. The commands  below clear the variables to be used, open the file, skip the header lines, and then read the data. The option RecordLists->True puts objects on separate lines into separate sublists.

Clear[in,datafile];
in=OpenRead["trial1.txt"]; (* open the file - insert the name you used when you saved it in LoggerPro *)
Skip[in,String,7]; (* skip the header *)
datafile=ReadList[in,Number,RecordLists->True];

Note that the .txt file should be saved in ANSI format, not UTF-8 for example!

Rearranging the data

The first command unpacks the data file into three vectors, time, channel 0, and channel 1. Then the next commands generate the data pairs.

{time,channel0}=Transpose[datafile];
adata0=Transpose[{time,channel0}];

Plotting your data

You can check your data with a plot:

ListPlot[adata0, PlotRange->All](*plots the data *)