RS232 serial communication to Arduino MEGA 2560 not working

Hello,

I am having some confusion interfacing with a load cell with a URS232A, RS232 to UART converter, which has the MAX232 level converter included.

I was previously successful getting a readout from the load cell but got sidetracked and when returning to my project focused on implementing other sensors and then trying to implement the RS232 later (Assuming it would be working).

When I run the code below, I get the error saying that the load cell cannot be found.

I am providing 5V to the URS232A, ground is connected and URS232A RX is connected to TX3 and vice versa on the MEGA

The information from the load cell is formatted in 8 data bits, 1 stop bit, no handshaking, no parity and is set up for continuous transmission. Manual Attached, page 20

int BAUD_IDE = 9600;
int BAUD_LOAD_CELL = 9600;
char serialData = "";
int data[15];

// serial port from weight controller

byte x;

void setup() {   
  Serial.begin(BAUD_IDE);
  Serial3.begin(BAUD_LOAD_CELL);
  delay(250);
  
}
void loop() 
{
   if (Serial3.available()) {
    int count = 0;
     while (count < 15){
      x = Serial3.read();
      Serial.write(x); 
      Serial.print(" , ");
      data[count] = x;
      delay;
      count++;
      }
    Serial.println();
    for(count = 0;count<15;count++){
      Serial.write(data[count]);
      Serial.print(",");
    }
    delay(2000);
    Serial.println();
  }
  else
  {
     Serial.println("Error: can not communicate with load cell");
     delay(2000);
  }
  
}

op-900-manual.pdf (409 KB)

You wrote: "When I run the code below, I get the error saying that the load cell cannot be found. ". Since that message appears nowhere in the code you supplied, it's going to be a long thread until the source of the problem is discovered!

Paul

Sorry, I guess that's unclear. I changed the original post and this reply to more clearly communicate the error statement.

Because this if statement is not true

if (Serial3.available()) {

Then it goes to the else statement

else
  {
     Serial.println("Error: can not communicate with load cell");
     delay(2000);
  }

Which is the error statement I am referring to.

To add a bit more context as well, the Load Cell is operating in C18 mode 1, continuous output. I kind of think that C18 mode 3 could be a valid alternative if I prompted the load cell with an input of "R". I don't know much about serial communication though.

The baud rate of the load cell is 9600, I have confirmed that in the settings.