Arduino to Plx-daq (Microsoft Excel) communication

Hello to everyone,

There is a sample coding for Arduino to Plx-daq (Microsoft Excel) communication. (Arduino to excel Communication ✔ - YouTube)

But I could not transfer the data in my own project. My encoder gives the displacement and speed outputs to the serial port. I want to send these outputs to Plx-daq. Can you help with coding?

The code of the sample

void setup(){
Serial.begin(9600);
Serial.println("CLEARDATA");
Serial.println("LABEL,Acolumn,Bcolumn,...");
Serial.println("RESETTIMER");
}
void loop(){
int sensorValue = analogRead(A0);
Serial.print("DATA,TIME,TIMER,");
Serial.println(sensorValue);
delay(1);
}

My project...

//Encoder pins
const int encoderPinA = 2;
const int encoderPinB = 3;
const int encoderPinZ = 4;

//The number of pulses produced by the encoder within a revolution.
const int PPR = 1000;
//The value is '1' if the encoder is not attached to any motor.
const int gearRatio = 1;
//When using 2X encoding the value is '2'. In this code 4X encoding is used.
const int decodeNumber = 1;
//record the cuurent number of pulses received
volatile long int currentPosition = 0;

unsigned int timer_previous = 0;
double wheel_turns = 0.0;
double current_wheel_distance = 0.0;
double previous_wheel_distance = 0.0;
double time_taken = 0;
double wheel_speed_mpms = 0.0;
double wheel_speed_mpm = 0.0;
double pi = 3.14;
double r = 0.04775; // Radius of the wheel in meters

void setup() {
  pinMode (encoderPinA, INPUT_PULLUP);
  pinMode (encoderPinB, INPUT_PULLUP);
  attachInterrupt (digitalPinToInterrupt (encoderPinA), doEncoderA, CHANGE);
  attachInterrupt (digitalPinToInterrupt (encoderPinB), doEncoderB, CHANGE);
  Serial.begin (115200);
  Serial.println("CLEARDATA");
  Serial.println("LABEL,Acolumn,Bcolumn,...");
}
void loop() {
  current_wheel_distance = (currentPosition * 2 * pi * r) / (PPR * gearRatio * decodeNumber) ; // Gives the distance which the wheel traveled. 'r' is the radius of the wheel in meters.
  time_taken = micros() - timer_previous; // Time taken since the previous iteration of the loop.
  wheel_speed_mpms = (current_wheel_distance-previous_wheel_distance) / time_taken; // This gives the speed in meters per microsecond.
  wheel_speed_mpm = wheel_speed_mpms * 1000000 * 60; // This gives the speed in meters per minute.

  Serial.print(current_wheel_distance, 2);
  Serial.print(" ");
  Serial.print(wheel_speed_mpm, 2);
  Serial.println();

  timer_previous = micros();
  previous_wheel_distance = current_wheel_distance;
}

void doEncoderA()
{
  if (digitalRead(encoderPinA) != digitalRead(encoderPinB))
  {
    currentPosition++;
  }
  else
  {
    currentPosition--;
  }
}
void doEncoderB()
{
  if (digitalRead(encoderPinA) == digitalRead(encoderPinB))
  {
    currentPosition++;
  }
  else
  {
    currentPosition--;
  }
}


Did you get the example working?

If so take note of this line, as it is extremely important:

Serial.print("DATA,TIME,TIMER,");

As you were told in your other post, consult the Beginner's Guide.

Unfortunately I couldn't do it, I've been trying since yesterday

You could not read the Beginner's Guide?

IF you can see what you expect to see on the serial monitor, there is nothing intrinsically wrong with your code. Arduino is simply sending the data to its serial port with no interest as to what is on the other side.

I submit your real problem is that you are picking up ancient stuff. The macro from Parallax is only good up to Microsoft Office 2003, so the first thing you need to to do is confirm that you are not using a newer version. Failing that, you might look at Netdevil's masterpiece PLX v2 on this forum, which is good for later versions of Excel and also 64bit operation.

PLX-DAQ version 2 - now with 64 bit support! (and further new features)

You might also check out the DataStream facility included in the current version of Excel.

Being a dyed-in-the-wool Office 2000 user myself, I'm not familiar with either of the above, but the PLX v2 thread is about the biggest and most important on this forum, and you can't possibly be short of support.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.