Go Down

Topic: How can I link PLX-DAQ to my Arduino ? (Read 561 times) previous topic - next topic

drizzer

Good day everyone. I am new to this sort of things but I am willing to learn so please bare with me and I am hoping that sum1 can help me with my queries.

My project is a wireless power monitoring system and Im using a 433MHz rf module. I can already send the parameters I wanted to send from the RF transmitter to my RF receiver both connected with each own arduino (UNO). The arduino on my receiver side is connected to my laptop for monitoring purposes. Using the serial monitor of arduino I can already monitor the data sent from my transmitter. Attached with this is a picture of it.  Now I really want to display this data on PLX-DAQ which I found on the post of NetDevil here in this community. The PLX-DAQ is in smooth condition when I  tested it using sensor values but during testing I didnt use the RF module. I am hoping that sum1 can help me to link my arduino (uno) which is connected to my RF receiver to PLX-DAQ so that I can use the excel to monitor the data instead of the serial monitor. Again I attached a picture showing the result on the arduino serial monitor. This is my code for my receiver :

#include <DataCoder.h>
#include <VirtualWire.h>

const int rx_pin = 11;
const int led_pin = 13;

void setup()
{
  delay(1000);
  Serial.begin(9600);
  pinMode(led_pin,OUTPUT);
  digitalWrite(led_pin,LOW);
  vw_set_rx_pin(rx_pin);
  vw_setup(1000);
  vw_rx_start();
 

}
void loop()
{
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
 
  union RFData inDataSeq;
 
  float inArray[4];
 
  if(vw_get_message(buf,&buflen))
  {
        digitalWrite(led_pin, HIGH);
       
        for(int i =0; i< buflen; i++)
        {
          inDataSeq.s = buf;
        }
       
        Serial.println();
       
        digitalWrite(led_pin, LOW);
       
        DecodeRFData(inArray, inDataSeq);
       
       
        Serial.print("realPower:");
       
        for (int i=0; i < 1; i++)
         {
           Serial.print(inArray);
           Serial.print(", ");
         }
       
        Serial.print("Irms:");
       
        for (int i=1; i < 2; i++)
         {
           Serial.print(inArray);
           Serial.print(", ");
         }
         Serial.print("supplyVoltage:");
       
        for (int i=2; i < 3; i++)
         {
           Serial.print(inArray);
           Serial.print(", ");
         }
         
         Serial.print("powerFActor:");
       
        for (int i=3; i < 4; i++)
         {
           Serial.print(inArray);
           Serial.println(", ");
         }
         
         
}

}


jremington

#1
Jan 12, 2018, 07:39 pm Last Edit: Jan 12, 2018, 07:40 pm by jremington
Please edit your post to enclose the code in code tags ("</>" button).

PLX-DAQ reads a serial port on the PC, so that is how the data have to be presented.

drizzer

Good day to all. I am currently doing a project for a wireless monitoring system using the 433MHz RF module. I was already able to send the needed data,receive it and display it in my arduino serial monitor. My problem is how to edit my code on the receiver side to initialized and link it so that I can monitor my data using the PLX-DAQ on excel. Attached here is a photo of my data on the arduino serial monitor. This is the code I am currently working on but somehow I cant initialized the PLX-DAQ with the code. Please if someone can lend me some hand I would really appreciate it.


Code: [Select]
#include <DataCoder.h>
#include <VirtualWire.h>

const int rx_pin = 11;
const int led_pin = 13;

void setup()
{
  delay(1000);
  Serial.begin(9600);
  pinMode(led_pin,OUTPUT);
  digitalWrite(led_pin,LOW);
  vw_set_rx_pin(rx_pin);
  vw_setup(1000);
  vw_rx_start();
 
  Serial.println("CLEARDATA");
  Serial.print("LABEL,Date,Time,realPower,apparentPower,powerFActor,supplyVoltage,Irms");

}
void loop()
{
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
 
  union RFData inDataSeq;
 
  float inArray[4];
  float realPower = realPower;
  float Irms = Irms;
  float supplyVoltage = supplyVoltage;
  float powerFActor = powerFActor;
 
  if(vw_get_message(buf,&buflen))
  {
        digitalWrite(led_pin, HIGH);
       
        for(int i =0; i< buflen; i++)
        {
          inDataSeq.s[i] = buf[i];
        }
       
        Serial.println();
       
        digitalWrite(led_pin, LOW);
       
        DecodeRFData(inArray, inDataSeq);
       
       
        float realPower;
       
        for (int i=0; i < 1; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
       
        float Irms;
       
        for (int i=1; i < 2; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
         
         float supplyVoltage;
       
        for (int i=2; i < 3; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
         
         float powerFActor;
       
        for (int i=3; i < 4; i++)
         {
           Serial.print(inArray[i]);
           Serial.println(", ");
         }
         
        Serial.print("DATA,DATE,TIME");
        Serial.print(realPower);
        Serial.print(",");
        Serial.print(powerFActor);
        Serial.print(",");
        Serial.print(supplyVoltage);
        Serial.print(",");
        Serial.println(Irms);
         
         
}

}

pert

DON'T CROSS POST!!!!!!!!!!!!!!!!!!!!
http://forum.arduino.cc/index.php?topic=522243
I HAVE REPORTED THIS THREAD TO THE MODERATORS

drizzer

Good day sir. Can you lend me a hand with this. This is the code I am currently writing on but somehow I was not able initialized the PLX-DAQ however I can see the values on the serial monitor if I open it but no data can be seen in the PLX-DAQ.

Code: [Select]
#include <DataCoder.h>
#include <VirtualWire.h>

const int rx_pin = 11;
const int led_pin = 13;

void setup()
{
  delay(1000);
  Serial.begin(9600);
  pinMode(led_pin,OUTPUT);
  digitalWrite(led_pin,LOW);
  vw_set_rx_pin(rx_pin);
  vw_setup(1000);
  vw_rx_start();
 
  Serial.println("CLEARDATA");
  Serial.print("LABEL,Date,Time,realPower,apparentPower,powerFActor,supplyVoltage,Irms");

}
void loop()
{
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
 
  union RFData inDataSeq;
 
  float inArray[4];
  float realPower = realPower;
  float Irms = Irms;
  float supplyVoltage = supplyVoltage;
  float powerFActor = powerFActor;
 
  if(vw_get_message(buf,&buflen))
  {
        digitalWrite(led_pin, HIGH);
       
        for(int i =0; i< buflen; i++)
        {
          inDataSeq.s[i] = buf[i];
        }
       
        Serial.println();
       
        digitalWrite(led_pin, LOW);
       
        DecodeRFData(inArray, inDataSeq);
       
       
        float realPower;
       
        for (int i=0; i < 1; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
       
        float Irms;
       
        for (int i=1; i < 2; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
         
         float supplyVoltage;
       
        for (int i=2; i < 3; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
         
         float powerFActor;
       
        for (int i=3; i < 4; i++)
         {
           Serial.print(inArray[i]);
           Serial.println(", ");
         }
         
        Serial.print("DATA,DATE,TIME");
        Serial.print(realPower);
        Serial.print(",");
        Serial.print(powerFActor);
        Serial.print(",");
        Serial.print(supplyVoltage);
        Serial.print(",");
        Serial.println(Irms);
         
         
}

}

Coding Badly


Nick_Pyner

There is a thread here by netdevil that should have everything you need. As far as Arduinho is concerned, it a matter of serial.print in the required format. All the setting up is at the PC end

pert


Go Up