analog channels. I created the plot using the built-in Excel
functions so that any data written into the columns D, E,
and F would be plotted in real time as it came in, using
column B — the time — as the X axis.
A Little Finesse —
Making Life Easier
It really took me less than five minutes after opening
PLX-DAQ for the first time before I had data in Excel and
plotted. Now, I was ready to add a few simple features to
clean up the data.
PLX-DAQ understands a few code words. The word
DATA in front of each line of data (separated by commas)
is the command to place each data value in a separate
cell on the same row.
The line feed
Serial.println(), as the last line in the
serial.print statements, also prints the line feed and tells
PLX-DAQ to add the next set of data to a new row.
There are two other commands I find very useful. The
first is CLEARDATA. When this key word is printed to the
serial port, PLX-DAQ will clear the cells in the Excel
spreadsheet and move its pointer to start adding data to
row 1 in the first worksheet. This means I can use the
same worksheet over and over again — especially if I have
a graph already formatted the way I want.
When I have a set of data collected and I want to
keep it, I make a copy of it and place the copy in the first
sheet position. This is done with a right mouse click on
the worksheet tab and selecting the copy command.
Now, I have a new worksheet ready to collect and
plot data with formatted plots, but it’s full of old data.
When the CLEARDATA command is sent, the old data in
this new spreadsheet is cleared out and I start over with a
blank worksheet. Fortunately, a plot is already formatted,
waiting for new data to plot.
The second command that makes my life easier is
LABEL. I like to have my data as well documented as
possible. In this simple example, I wanted to display five
columns of data, the number of points averaged per data
value, the real time each data point was taken, and the
three analog values from each channel. I used the LABEL
command to send the labels for each column (separated
by commas) as the first command.
This command only needs to be sent once, to set up
the column labels. I put this in the void setup() function,
so it executes right at the beginning of the sketch. Since I
wanted a little flexibility on how I use the serial port, I
added the flag to only print the LABEL command and
values if the PLX_flag is set for true. These commands are
June 2015 37
Avoid this common problem: While the standard baud
rate for the serial port is 57600, PLX-DAQ only offers the option for
56000. If you use 57600, some of the data read by PLX-DAQ will be
garbled. You must set up the baud rate in the Arduino sketch with the
same value as you select in PLX-DAQ. I recommend the highest value
of 56000 as your default.
Avoid this common problem: Only one device can use the
serial port at a time. The most common mistake I make is having the
serial monitor open to read the serial port while I want to have PLX-DAQ read the data. I get an error in this case. Wait for the code to be
uploaded to the Arduino and be running. Make sure nothing else is
talking over the same COM port, and then click the “connect” button.
Likewise, to talk to the Arduino, be sure to click the “disconnect”
button on the PLX-DAQ dialog box to free up the serial port
connection for the Arduino.
FIGURE 6. The final result: The spreadsheet showing the data as it came in and the resulting plot of the three channels of
ADCvalues (0 to 1023) using the time stamp data. This plot can be modified using standard Excel tools.