Go Down

Topic: Transfer of serial monitor value to PLX-DAQ (Read 438 times) previous topic - next topic

modhu_54

Jan 13, 2021, 11:33 am Last Edit: Jan 13, 2021, 11:34 am by modhu_54
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

Please help

modhu_54

output on the excel I am getting


Nick_Pyner

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

modhu_54

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.

Nick_Pyner

#4
Jan 14, 2021, 02:06 pm Last Edit: Jan 14, 2021, 02:08 pm by Nick_Pyner
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);

modhu_54

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.

sumguy

#6
Jan 28, 2021, 09:58 pm Last Edit: Jan 28, 2021, 10:17 pm by sumguy
"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);



Go Up