Viewing CAN data on Excel Streamer

I am working on a project where I would like to send CAN data for photosensitive sensor measurements from an Ardunio Nano to Ardunio Uno, and each microcontroller is connected with an MCP 2515 CAN module and the modules are connected to each other with CAN-High and CAN_Low. On each computer connected with the microcontrollers, I am trying to view the data on the serial port using Microsoft Excel Data Streamer. When I connect the device and click Start Data, no data is being shown on either of the computers.
By checking the serial monitor on both ends, it does show the data being sent and received, but nothing is shown on the Excel Dtat Streamer. Is there anything additional I need to add to the Arduino code or change the Streamer's setup?

Below, is the code I am using to read the data from the sensor and send it through CAN:

const int LightSensor = A0; 
unsigned char AmbLight[1]; 
const int spiCSPin = 10;
int ledHIGH = 1;
int ledLOW = 0;

#include <SPI.h>
#include <mcp_can.h>
MCP_CAN CAN(spiCSPin);

void setup() {
  Serial.begin(115200);
  Serial.println("CLEARDATA"); //clears up any data left from previous projects in Excel
  //Serial.println("LABEL,Acolumn,Bcolumn,..."); //always write LABEL, so excel knows the next things will be the names of the columns (instead of Acolumn you could write Time for instance)
  while (CAN_OK != CAN.begin(CAN_500KBPS))
    {
        Serial.println("CAN BUS init Failed");
        delay(100);
    }
    Serial.println("CAN BUS Shield Init OK!");
}

void loop() {
  float AmbL = analogRead(LightSensor);
   AmbLight[0] = AmbL;
  if (AmbLight[0] != NULL){
    CAN.sendMsgBuf(0x43, 0, 1, AmbLight[0]); 
    Serial.println(AmbLight[0]); 
  }

}

And here is the code I use to receive the data through CAN:

#include <SPI.h>
#include "mcp_can.h"

const int spiCSPin = 10;
const int ledPin = 2;
boolean ledON = 1;
//char state;

MCP_CAN CAN(spiCSPin);

void setup()
{
    Serial.begin(115200);
    pinMode(ledPin,OUTPUT);

    while (CAN_OK != CAN.begin(CAN_500KBPS))
    {
        Serial.println("CAN BUS Init Failed");
        delay(100);
    }
    Serial.println("CAN BUS  Init OK!");
}


void loop()
{
    unsigned char len = 0;
    char buf[8];

    if(CAN_MSGAVAIL == CAN.checkReceive())
    {
        CAN.readMsgBuf(&len, buf);

        unsigned long canId = CAN.getCanId();

        Serial.println("-----------------------------");
        Serial.print("Data from ID: 0x");
        Serial.println(canId, HEX);

        for(int i = 0; i<len; i++)
        {
            //state = buf[i];
            Serial.print(buf[i]);
            //printf("buf[i]=%c",buf[i]);
            Serial.print("\t");
            

        }
        delay(500);
        Serial.println();
    }
}

Maybe this is a PC problem. I understand that the two Arduinos are interconnected by CAN and both connected to their own PC using a serial monitor. And it works.

I can't imagine anything special is needed in Arduino code. it is simply sending data to the serial port, and has no idea what is on the other side listening.

Therefore you simply need to replace the serial monitor with Exce, and ensure that each Excel is looking at the relevant serial port, which I don't think is happening.

I have never heard of Excel Streamer but I'm sure that, when using PLX, or a standard PC terminal, you simply use the same port as the serial monitor. I imagine the same applies here. Also, it may be that the serial monitor must be inoperative when Excel Streamer is used.

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