Understanding the ".csv" file generated by "save chart data"

Support forum for MegunoLink
Post Reply
pramit1288
Posts: 1
Joined: Mon Jun 13, 2016 11:44 am

Mon Jun 13, 2016 12:23 pm

Helloo!

I am new with MegunoLink and I find it just wonderful! I really wnat to congratulate the team working on it! Really sophisticated software! :) :)

I am right now a trial user but have already ordered one copy in name of my research centre. I trying a simple project. I am using MegunoLink as a tool to plot sensor data from two pressure sensors in real time using "TimePlot" visualizer. But one strange thing which I am facing is that I can#t understand the .csv file generated when I press 'save chart data'. Though I can see the pressure values in the file, I can#t really understand the time stamps.. These are some really large numbers like:
42534.0613491666,
How do I interpret this value! Is it a time stamp at all? Maybe in trial version this feature doesnt work? I am really confused! :roll:
I a sharing my arduino code below:

Code: Select all

#include <MegunoLink.h>
 
TimePlot MyPlot; 


int analogInPin0 = A0;  // Analog input pins that the Refernece sensors are attached to
int analogInPin1 = A1;
int sensorValue0 = 0;        // value read from the pot
int sensorValue1 = 0;
int Max = 1023;        // minimum sensor value
int Min = 0;           // maximum sensor value


void setup() {
 pinMode(A0, INPUT);
 pinMode(A1, INPUT);

  // initialize serial communications at 9600 bps:
  Serial.begin(9600); 
  Serial.println("live plotter");
  MyPlot.SetTitle("Live sensor data");
  MyPlot.SetXlabel("Time (sec)");
  MyPlot.SetYlabel("Pressure (mbar)");
}

void loop() {

  sensorValue0 = analogRead(analogInPin0); 
  sensorValue1 = analogRead(analogInPin1);
  float voltage0 = sensorValue0 * (5.0 / 1023.0);
  float voltage1 = sensorValue1 * (5.000 / 1023.000);
  float pressure0 = ((voltage0*12.5)-28.125);
  float pressure1 = ((voltage1*12.5)-28.125);
   //Serial.print(sensorValue0); 
  Serial.print(pressure0,4); 
  Serial.print(",");
  Serial.println(pressure1,4);
  MyPlot.SendData("pressure_shortertube",pressure0, TimePlot::Red, TimePlot::Solid, 3, TimePlot::Circle);
  MyPlot.SendData("pressure_longertube",pressure1, TimePlot::Blue, TimePlot::Dashed, 3, TimePlot::Circle);
  delay(200);
}

For the TimePlot, I am using the time properties as shown in the attached screenshot...

I really look forward to your support! Thanking you in advances

Cheers! :) :)

Pramit
Attachments
screen.jpg
screen.jpg (133.22 KiB) Viewed 10592 times
philr
Posts: 463
Joined: Mon May 26, 2014 10:58 am

Sat Jun 18, 2016 7:47 am

Hi Pramit, the plot exports the dates as serial dates (something excel understands). All you need to do is format those cells as a date and excel will display the right thing (I think its on the Home ribbon under Number, normally it says "General" but you can change it to "Short date", "Long date" etc).
Post Reply