With data logging in MakerPlot, you’re not limited to
the last 3,000 or so data points; you can log any amount
of analog and digital data that you choose for as long as
you choose — minutes, hours, days, etc. — to either a text
file or a CSV file. Remember, you’re basically saving a text
file to a computer hard disk and not just a few memory
chips on your micro’s board. So, there are no practical
memory-limiting issues to worry about when data logging
with MakerPlot. Here’s how it’s done.
First, take a look at the Logging menu at the bottom
in Figure 11. On the left side, you’ll see the Log to File
button and below it, two text boxes with file names. The
first text box is for logging data and the bottom text box is
for logging messages. Messages, by the way, are an
important alerting feature since you can program
MakerPlot to output messages based on certain data
levels or combinations, and then you can log these
messages with date and time stamps for later analysis. We
won’t be getting into logging messages in this example;
however, just be aware that you can.
The default data text file is dig_dat.txt which means
that logged data will be sent to this file name which — by
the way — is a standard text file with a .txt extension. We’ll
change the file name and extension to reflect logging our
analog and digital data to the CSV file. Once again, this is
easily done by simply clicking on the text box just below
the Log to File button and keying in a new file name. The
one chosen is called ana_dig.csv (Figure 12). With that
done, let’s log some data.
Click the red rocker switch in the Control menu to
start the data flowing into MakerPlot. Now, click on the
Log to File button which will change from yellow to green.
As long as it stays green, every data packet from the Uno
will be logged and time stamped. Let a few seconds go by
and then click the Log to File button again; this ends the
data logging session. Now, let’s look at what got logged.
Click on the Open button next to the ana_dig.csv text
box. This brings up the NotePad file of the logged data
(Figure 13). Here, we can examine the logged data in
some detail. Looking at the first record (Figure 14), we see
that the numbers on the far left represent the date and
time (with time down to hundredths of a second). This is
followed by the time into plot (in thousandths of seconds)
followed, in turn, by the state of the eight digital data bits
(MSB to LSB), then is followed by the analog value of the
potentiometer. If there were more analog channels for
logging, they would follow this one. As you can further
see, these individual fields are separated by commas
which will allow for direct transfer to Excel.
Where, you might ask, is this file on the hard disk?
When you install MakerPlot, the default location is My
Documents ➜ MakerPlot ➜ Data which is where you’ll
find it. Just make sure to turn on your file extensions to
48 January 2014
Figure 15. Plot of logged data.
Figure 14. Typical data log record.
Figure 13. Logged data in NotePad.