Arduino Forum

Using Arduino => Interfacing w/ Software on the Computer => Topic started by: modhu_54 on Jan 13, 2021, 11:33 am

Title: Transfer of serial monitor value to PLX-DAQ
Post by: modhu_54 on Jan 13, 2021, 11:33 am
Hello everyone I am trying to get the sensor value from Serial Monitor of Arduino IDE to PLX-DAQ software.
I am getting the time value , but NOT the value of sensor reading . Here is the code I am using

Code: [Select]
int led=4;
int sensor=A0;
int threshold=90;
void setup() {
  pinMode(4,OUTPUT);
  pinMode(A0,INPUT);
 Serial.begin(9600);
 Serial.println("CLEARDATA");
 Serial.println("LABEL,Time,value");
 Serial.println("RESETTIMER");
}

void loop() {
  int value=analogRead(sensor);
  Serial.println("DATA,TIMER");
  Serial.println(value);
  Serial.println(',');
  if (value>=threshold)
  {
    digitalWrite(4, HIGH);
    delay(100);
   
  }
  else
  digitalWrite(4, LOW);
  delay(100);
}

 And the output on the excel I am getting
(http://https://shybananasharkpeach.tumblr.com/post/640191248438870016)
Please help
Title: Re: Transfer of serial monitor value to PLX-DAQ
Post by: modhu_54 on Jan 13, 2021, 11:58 am
output on the excel I am getting

(https://forum.arduino.cc/index.php?action=dlattach;topic=722753.0;attach=398619)
Title: Re: Transfer of serial monitor value to PLX-DAQ
Post by: Nick_Pyner on Jan 13, 2021, 03:12 pm
but NOT the value of sensor reading .
and I bet you are not getting the time value either. The serial monitor is not a source of data.

PLX uses the PC clock to get the time, and I guess a timer as well.

I thought I was the last person in the known universe to be using the original PLX macro, but it seems that you are too and you may thus be getting no joy because you are not using Excel 2003 or earlier. If this is the case, you might look at using the newer version of PLX.

https://forum.arduino.cc/index.php?topic=437398.0
Title: Re: Transfer of serial monitor value to PLX-DAQ
Post by: modhu_54 on Jan 14, 2021, 08:42 am
I am using the v2.11 the latest version,from this site https://forum.arduino.cc/index.php?topic=437398.0
and tried on EXCEL 2007 but still  I am getting the same results.
Not getting the value on excel , just timer only.
Title: Re: Transfer of serial monitor value to PLX-DAQ
Post by: Nick_Pyner on Jan 14, 2021, 02:06 pm
Some of your code is most certainly redundant, but I can only guess that that is actually a problem. Also note missing comma. Instead of
Code: [Select]
  Serial.println("DATA,TIMER");
  Serial.println(value);
  Serial.println(',');

You might try
Code: [Select]
  Serial.println("DATA,TIMER,");
  Serial.println(value);
Title: Re: Transfer of serial monitor value to PLX-DAQ
Post by: modhu_54 on Jan 16, 2021, 06:19 am
Code: [Select]
Serial.println("DATA,TIMER,");[color=#222222][/color]
  Serial.println(value);

Hello I tried the changes in the code, but still having the same problem.
Title: Re: Transfer of serial monitor value to PLX-DAQ
Post by: sumguy on Jan 28, 2021, 09:58 pm
"println" appends an end of line character which should only appear at the completion of the data string


Code: [Select]
Serial.print("DATA,TIMER,");
Serial.println(value);