Arduino Uno to Excel using PLX-DAQ


i given code word "bob" line of serial data...i since tried tweak work with , having no luck...i'm trying use pin 10 receive serial data ardunio.  send lines contain "bob" in them excel using plx-daq.  anytime pin 10 on arduino sees serial data, process data , "bob", send entire line containing "bob'" excel , when if new line of data containing "bob" comes in, update next row in excel.  here's have not working.... appreciate suggestions...thank in advance.

code: [select]
#include <softwareserial.h>

softwareserial myserial(10);  //rx on pin 10

char pattern[] = "bob";
char row = 0;

void setup() {
  serial.begin(38400);
  //serial.print(f("looking '"));
  //serial.print(pattern);
  //serial.println(f("'"));



myserial.begin(38400); // bigger number better
//pinmode(rxpin, input)
serial.println("cleardata"); //clears data left previous projects

serial.println("label,acolumn,"); //always write label, excel knows next things names of columns (instead of acolumn write time instance)


}

void loop() {
  byte inchar;
  bool docheck = false;
  const byte linebuffersize = 65;
  static char scbuffer[linebuffersize];
  static byte buffindex = 0;

while (myserial.available() > 0) {
    inchar = myserial.read();
    if (inchar == 10) {
      continue;
    } else if (inchar == 13) {
      docheck = buffindex;
    } else {
      if ((buffindex == 0) && iswhitespace(inchar)) {
        continue;
      }
      scbuffer[buffindex++] = inchar;{
      docheck = (buffindex == (linebuffersize - 1));
    }
    if (docheck) {
      scbuffer[buffindex] = 0;
      if (strstr(scbuffer, pattern))
        serial.print("data,scbuffer");{
     
      buffindex = 0;

serial.print("data,scbuffer,"); //writes time in first column , time since measurements started in column b
row++;
  row=0;
 
serial.println("row,set,2");

//serial.println(...); //be sure add println last command knows go next row on second run

    delay(100); //add delay
}
}   
}
}
}

your code , intentions, not mention reasons why, incomprehensible. there 2 lines of note:
1.
code: [select]
myserial.begin(38400); // bigger number better
is nonsensense. 38400 may cause of problem, faster software serial kiss of death, , changing 9600 may fix problem.

2.
code: [select]
serial.println("label,acolumn,")
means sending data plx on hardware serial, usb cable, in normal manner, fine. means can send same data serial monitor in normal manner , test ok. if is, problem setting of plx.

the problem plx may mismatch in baud rate, note can sure of getting plx work office 2003 , earlier.


Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > Arduino Uno to Excel using PLX-DAQ


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'