Pages: [1]   Go Down
Author Topic: plx-daq  (Read 1796 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

is there a library for PLX-DAQ?  I got it working but it was not very pretty!  Its control and directives needed to be in all caps with the values comma separated.   This was the only way I could get the data to show up in the excel program.
Code:
int val = 0;
int val1 = 0;

void setup() {
      Serial.begin(9600);      // opens serial port, sets data rate to 9600 bps
        //int val = 0;
}

void loop() {
delay(500);
val++;
if (val > 29) Serial.println("CLEARDATA");
Serial.print(byte(68));
Serial.print(byte(65));
Serial.print(byte(84));
Serial.print(byte(65));
Serial.print(byte(44));
Serial.print("TIME");
Serial.print(byte(44));
Serial.println(val1);
//if (val > 29) Serial.println("CLEARDATA");
if (val > 29) val = 0;
val1 = random(50, 75);
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, was doing things the hard way.  Took a step back and now I see how easy it was to do.  I need a board so I can smack my self in the head!  But hey, I did learn something and that is the big thing.
Logged

new zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I am new to Arduino and  plx-daq. Very interested in your sketch to talk to plx....can you post new 'easy way' sketch on how you communicate with plx?
Thanks,
k
Logged

new zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After mucking around a bit, maybe something like this? -not sure if this is the most efficient way.

int val = 0;
int val1 = 0;
void setup() {
      Serial.begin(9600);      // opens serial port, sets data rate to 9600 bps
        //int val = 0;
        Serial.println("CLEARDATA");
}

void loop() {
Serial.print("DATA,TIME,");
Serial.println(val1);
val1 = random(0, 100);
delay(3000);

}
Logged

Pages: [1]   Go Up
Jump to: