Reading Arduino Serial Input I am reading an input from my Ohaus weighing scale using it's RS232 output using this code:

#define HWSERIAL Serial1

void setup() {
  Serial.begin(9600);
  HWSERIAL.begin(9600);
}

void loop() {
  int incomingByte;

  if (Serial.available() &gt; 0) {
    incomingByte = Serial.read();
    Serial.print("USB received: ");
    Serial.println(incomingByte, DEC);
    //HWSERIAL.print("USB received:");
    //HWSERIAL.println(incomingByte, DEC);
  }
  if (HWSERIAL.available() &gt; 0) {
    incomingByte = HWSERIAL.read();
    Serial.print("UART received: ");
    Serial.println(incomingByte);
    //HWSERIAL.print("UART received:");
    //HWSERIAL.println(incomingByte);
  }
}


When pressing the print button on the scale, I was expecting data to come over in single burst with just the readings, but what I am getting is the expected data, but the scale keeps sending data afterwards (ES over and over). I need to parse out just what's needed. The below is the output from the console on my computer.

UART received:  
UART received:  
UART received:  
UART received:  
UART received: 0
UART received: .
UART received: 0
UART received: 0
UART received:  
UART received:  
UART received:  
UART received:  
UART received:  
UART received:  
UART received: ?
UART received: (This is a CR)

UART received: (This is a LF)

UART received:  
UART received:  
UART received:  
UART received:  
UART received: 0
UART received: .
UART received: 4
UART received: 0
UART received:  
UART received:  
UART received:  
UART received:  
UART received:  
UART received:  
UART received: ?
UART received: G
UART received:  
UART received:  
UART received: (CR)

UART received: (LF)

UART received: E
UART received: S
UART received: (CR)

UART received: (LF)
... (The ES loops over and over until the print button is pressed again)


0.00 is the current scale reading and 0.40 is the tare weight. That's all I need and I can't figure out how to parse it. The blocks aren't the same length so how do I pull out the needed information and ignore the repetitive 'ES'? I'm not 100% sure if I'm even going about this the right way?

Output as DEC

UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 48
UART received: 46
UART received: 48
UART received: 48
UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 63
UART received: 13
UART received: 10
UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 48
UART received: 46
UART received: 52
UART received: 48
UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 32
UART received: 63
UART received: 71
UART received: 32
UART received: 32
UART received: 13
UART received: 10
UART received: 69
UART received: 83
UART received: 13
UART received: 10
UART received: 69
UART received: 83
...
From the manual:
http://dmx.ohaus.com/WorkArea/showcontent.aspx?id=4294974226


  The balance will return “ES” for invalid commands.


Check to make sure you're using the correct serial parameters that the RX line is wired correctly.