Go Down

Topic: PLX-DAQ Arduino-Excel Logging Issue (Read 445 times) previous topic - next topic

Sherringfarms

Hello, I am having an issue with a really cool project. I am logging my growing control arduino and atmosphere control arduino data to PLX DAQ v2.11 so that I can transfer it to Power BI and use it in a Microsoft flow program to create data driven alerts to my family and automatically generate to-do lists for us. I finished writing the flow and connected the excel/flow to power BI, but still have an issue with the PLX-DAQ...

The issue is that when I connect to PLX-DAQ, it is writing everything correctly in the raw datalogger and even creates the correct labels on the spreadsheet. It doesn't post anything in the rows under the labels on the spreadsheet though, despite the fact that the raw data logger continues to show information coming in.

If you all would be so kind, I'll post my arduino code here and maybe someone can tell me if I did something wrong? I'll apologize straight away for an error somewhere with my humidity that I still have to work out. But if you see the PLX DAQ issue that would be great! Again I am using the 2.11 version.




Code: [Select]
const int ledRed = 11;
const int ledBlue = 12;
const int ledGreen = 13;
const int photocellPin = A0;
int putPin = A5;
int photocellVal;
float tempC;
float tempF;
int reading;
int tempPin = A4;
float humi = 0;
float prehum = 0;
float humconst = 0;
float truehum = 0;
float pretruehum = 0;
long pretruehumconst = 0;
long valb = 0;


void setup() {

Serial.begin(9600);
analogReference(INTERNAL);
pinMode (ledRed, OUTPUT);
pinMode (ledBlue, OUTPUT);
pinMode (ledGreen, OUTPUT);
Serial.println ("CLEARDATA");
Serial.println("LABEL,Computer Time,TempC,tempF,photocellval,truehum");
}


void loop() {

photocellVal = analogRead(photocellPin);
photocellVal = constrain(photocellVal,0,100);
reading = analogRead(tempPin);
tempC = reading / 9.31;
tempF = tempC * 1.8 + 32;
valb = analogRead(putPin);
prehum = (valb/9.31);
humconst = (0.16/0.0062);
humi = prehum - humconst;
pretruehumconst = 0.00216*tempC;
pretruehum = 1.0546-pretruehumconst;
truehum = humi/pretruehum ;

Serial.print("temperature = ");
Serial.print(tempC);
Serial.println("ºC");
Serial.print("temperature = ");
Serial.print(tempF);
Serial.println("ºF");
Serial.print("light = ");
Serial.print(photocellVal);
Serial.println("% ");
Serial.print ("Humidity: ");
Serial.print ((long)truehum);
Serial.println ("% ");

if(tempC > 24){
  digitalWrite(ledRed, HIGH);
  digitalWrite(ledBlue, LOW);
  }
else if(tempC <= 24){
  digitalWrite(ledRed, LOW);
  digitalWrite(ledBlue, HIGH);
  }
if(photocellVal <= 50){
  digitalWrite(ledGreen, HIGH);
  }
else if(photocellVal > 50){
  digitalWrite(ledGreen, LOW);
  }
delay(1000);
}


The port and arduino board are selected correctly, but I can't figure this out for the life of me. Thanks so much for your help!

sumguy

PLX_DAQ works with keywords, for example to setup the labels the keyword is "LABEL", to clear data the keyword is "CLEARDATA", to print data the keyword is "DATA"

The keywords are listed in the PLX help file.

I didn't see the DATA keyword in your example code.

GijKieken

Read and examine your former post.

Go Up