Go Down

Topic: Data acquisition using excel or matlab (Read 8353 times) previous topic - next topic



I am working on a project where I am doing PI control on a system. The system has large delays and I need to plot the data over 24 hrs to see how the system is responding to my control algorithm.

The only problem is that I am not familiar on how to save the data that is appearing on the serial monitor to excel or matlab. Is anyone familiar with this and could assist me. I would prefer the data be stored on matlab.


Don't send me technical questions via Private Message.


PLX-daq doesn't want to run on my system.
I keep getting a run time error '424'


That's a worry......... PLX is just a macro for Excel. What version of Office and what operating system are you using?


For excel, I simply ctrl+A and ctrl+C then ctrl+V all data from Serial monitor to a cell in excel. For matlab, i do the same but save in *.txt format. You may name the file "data.txt".

Then in matlab use these functions:
Code: [Select]

load ('data.txt');
[row, column] = data; %% to store your data in a matrix with dimesion = row x column

p/s: you better log the data separated by a "tab" rather than a semicolon, comma or a dot.


I've used Processing on the laptop side to be writing data into .csv files.  the downside of this is that you can't open the excel files while data logging is taking place over the serial port.

Hope this helps.

The arduino side code is:

Code: [Select]

float Temp;

void setup()


void loop()
  Temp = analogRead(A1);
  Temp = 5.0*Temp*100.0/1024;

The processing side of the code is as:
Code: [Select]

import processing.serial.*;

Serial myPort;
PrintWriter output;

void setup()
  String[] portList = Serial.list();
  myPort = new Serial(this, portList[0],9600);
  output = createWriter("TempretureLog.csv");
  output.println("Time"+","+"Temp (in Deg. Cel.)");

void draw()
    String Temp = myPort.readStringUntil('\n');
  //else println("No Data");

void keyPressed()


Please, look here: http://www.aggsoft.com/asdl-rs232-to-excel.htm
The most simple way is to output the data from the device in the CSV format. In this case Advanced Serial Data Logger can capture it to an CSV file. You can open this file while the logger will write data to it. From my experience, it will be better to parse and write data to Access and read the captured data to Excel when you need it.


The Excel part is pretty easy...
Use a Leonardo, Pro Micro, or V-USB to simulate a keyboard.
Like my project here:

If the PC needs to be away, just use the same concept, pass data to SD-Card, import the <file.prn> into Excel later.



Hey there,

don't want to grave dig but the PLX DAQ 424 error got solved with version 2 of the software.

It can be found here on the forum ==> http://forum.arduino.cc/index.php?topic=437398.0 <==

I posted to this old thread as it is one of the highest ranked threads on Google and lots of people might look for a solution here. Once again, sorry for grave digging....

P.S.: it actually was an issue with 64 bit versions of Excel. PLX DAQ v1 is not compatible with those (v2 is !  :) )




Mar 06, 2017, 09:44 pm Last Edit: Mar 06, 2017, 09:45 pm by jremington
@Jonathan: Thanks very much for version 2 of PLX-DAQ!

I used the original a lot, but was stuck with old versions of Excel.

Go Up