multi column PLX output

I want to have a refreshing bar chart of six sensor outputs from Arduino Mega to PLX-DAQ. The Arduino sketch is controlling 6 light-to-frequency sensors, and sending data to serial monitor. PLX-DAQ is then used to display graph of data. In practice, the Arduino sketch is started, then the PLX-DAQ program is started to receive and graph the data, in Excel, from the Arduino sketch.

So the idea is to have one set of bars, refreshed every second or so, as in Capture.jpg below. The current code (TCS_6TCS_Polling_6LEDs_44.5_PLX.ino) is OK to graph new and old data, as in Capture2 below. In other words, goal is to to meter the current levels, not plot old data.

I think something like this piece of code (from can be used to keep the data in Excel in a single row for the graph: Serial.println(‚ÄúROW,SET,2‚ÄĚ); but I don‚Äôt know how to add it to the Arduino code. Any help appreciated.

Serial.print("DATA,TIME,"); // PLX-DAQ prints time and logs subsequent data.
  for(int i=0; i<6; i++) // 6 sensors
    Select_TCS_OUT(i); //TCS is light-to-frequency sensor
    int lastDigitalRead = HIGH;
    for(int j=0; j<20000; j++)
      int digitalReadValue = digitalRead(OUT);
      if (lastDigitalRead == LOW && digitalReadValue == HIGH) // records changes voltage to get Hz
      lastDigitalRead = digitalReadValue;

    if (i==5) {Serial.println(" , ");

    delay (10);
  }    // end i loop

void Select_TCS_OUT(int TCS_OUT) //6 sensors
  case TCS_1:   

  case TCS_2:  

  case TCS_3:  

  case TCS_4:  

  case TCS_5:    

  case TCS_6:       


TCS_6TCS_Polling_6LEDs_44.5_PLX.ino (2.49 KB)

1 Like

If I understand you correctly, I would not have thought this was a starter in Excel. This is because the product from Excel is probably designed with paper print in mind, and "live graph" is probably merely a paper print graph that that is constructed live before your eyes.

Therefore, what you need is a volatile display on an LCD.

Having said that, it might be possible if the X-data is constant relative to the Y-data, thereby overwriting the previous, but it is usually time or something, and isn't. If it can be done, I guess it will be all down to your Excel skills, and Arduino's job would be quite straightforward.