Pages: [1]   Go Down
Author Topic: real time plot with KST  (Read 2201 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have one analogic sensor that was working and show the numbers in a serial port. Now I need to save and plot this numbers. I know that kst can do this, but I dont know how.

Anyone can help me? to solve my problem to save the data on a .txt file and ploting it?

ty for the help
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 29
Posts: 1669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since you can "show the numbers in a serial port" I assume you can see them on the serial monitor. In that event all you need is a proper terminal programme like RealTerm, which enables you to record the data to a file.

Another option is to use PLX-DAQ, which is an Excel macro. This sends the data to a live excel spreadsheet and also allows you to make a real-time graph.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The data is show on serial monitor. The RealTerm works with me, but I would like to do the same thing without this software. Are there any possibility to I write directly in a .txt file?
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 29
Posts: 1669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would like to do the same thing without this software. Are there any possibility to I write directly in a .txt file?

Other than writing to an on-board SD card, probably not. Whatever you do, some software has to collect the data and record it, so what's wrong with using RealTerm anyway? It does a fine job, to the point where it is the bleeding obvious solution, and I imagine that any other solution would work the same way.
« Last Edit: September 18, 2013, 07:18:13 pm by Nick_Pyner » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My pc will be always connect to the arduino, so I dont need a SD card to save the data, I just need to save like a .txt file.

I dont want to use the RealTerm because I am project a datalogger and more than one person will use this. If it needed to open more than one program it will dificult a person who dont have to many ability with this stuffs.
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 29
Posts: 1669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

more than one person will use this. If it needed to open more than one program it will dificult a person who dont have to many ability with this stuffs.

In that event, backing up to an on-board SD is probably a good idea anyway.
Logged

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 10
Posts: 285
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You seem to want to have  your custom solution and in that case you need to write your own code. If you use Processing it will allow you to log the data directly either into a .txt file or a .csv (comma separated values) file which you can open with Excel. Its really easy and there are examples out there. Processing has  a powerful instruction  (PrintWriter) that allows you to do that really easily. The only problem is that you can't do the graph in real time if you log the data into Excel (or I don't know how to do that yet). After the data is logged in, then you have to manually set the graph in excel. I have done it and works just fine.

-Send the data from Arduino to Processing using the Serial communication library. There are tons of examples out there.
-Write the data into a .txt file or .csv if you want to use Excel and all its possibilities. For that you use PrintWriter.
PrintWriter datalogger;
datalogger=createWriter("datalogger.csv");(If no path is specified it will create the file in the sketch data file. If not, in the folder you specifiy the path for)
datalogger.println( data1, data2, data3,....,dataN); (writes data into different contiguous excel cells).
datalogger.println(); leaves a blank line of cells (not filled with data whenever you want).
datalogger.println(moredata, evenmoredata, extradata);
-Flush the data every once in a while in your code (on every Procesing loop or so).
datalogger.flush();
-Close the .txt file or .csv file at exit.
datalogger.close();
exit();

You can use the same thing with a .txt file; but to read the data back and make graphs will be a bit more complicated requiring loadStrings() into arrays and convertions to float(string);

If you want multiple files simply use arrays, like this:

PrintWriter []datalogger;

void setup()
{
datalogger=new PrintWriter[NumberOfFilesYouWant+1];
for (int i=0; i<NumberOfFilesYouWant+1;i++)
{
datalogger=createWriter("datalogger["+i+"].txt");
}
}




Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have problems with the real term, how can i configure it/?
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 29
Posts: 1669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a row of tabs under the black screen. You probably only need the first three and the settings are retained on closing. Needless to say, the baud rate has to match Arduino. The status lights at the end are available under any tab. Note that you have to press a button in the capture tab to actually start recording!
Logged

Pages: [1]   Go Up
Jump to: