Reading RS 232 Data with Teensy (and with arduino compiler)

Hi all, I needed help with reading RS 232 Data (pin 3) with Teensy 3.5, which is stressing me so much. I have googled a bunch, but could not find the solution to it.

I have connected the multimeter DM3068 RS232 output to the TTL converter, and then connected the pin 3 (data pin) of TTL converted RS 232 to Serial port 1 of the teensy. I have used the following code to obtain a single capacitance measurement signal (it was 110.5 micro farads).

int incomingByte = 0; // for incoming serial data

void setup() {
Serial1.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {

// send data only when you receive data:
if (Serial1.available() > 0) {
// read the incoming byte:
incomingByte = Serial1.read();

// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}

From this code, I have received an output on the serial monitor as the following:
I received: 49
I received: 46
I received: 49
I received: 48
I received: 53
I received: 51
I received: 51
I received: 49
I received: 69
I received: 45
I received: 48
I received: 52
I received: 13
I received: 10

Question: How will I be able to interpret this signal into a form of what I know? (value of 110.5 micro farads)

I have tried the following code as well, but I did not get any output on the serial monitor screen.

const byte numBytes = 32;
#define multimeter Serial1
byte receivedBytes[numBytes];
byte numReceived = 0;

boolean newData = false;

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

void loop() {
recvBytesWithStartEndMarkers();
showNewData();
}

void recvBytesWithStartEndMarkers() {
static boolean recvInProgress = false;
static byte ndx = 0;
byte startMarker = 0x3C;
byte endMarker = 0x3E;
byte rb;

while (multimeter.available() > 0 && newData == false) {
rb = multimeter.read();

if (recvInProgress == true) {
if (rb != endMarker) {
receivedBytes[ndx] = rb;
ndx++;
if (ndx >= numBytes) {
ndx = numBytes - 1;
}
}
else {
receivedBytes[ndx] = '\0'; // terminate the string
recvInProgress = false;
numReceived = ndx; // save the number for use when printing
ndx = 0;
newData = true;
}
}

else if (rb == startMarker) {
recvInProgress = true;
}
}
}

void showNewData() {
if (newData == true) {
Serial.print("This just in (HEX values)... ");
for (byte n = 0; n < numReceived; n++) {
Serial.print(receivedBytes[n], HEX);
Serial.print(' ');
}
Serial.println();
newData = false;
}
}

Thank you so so much in advance!

You don't have a start marker; use the receive-with-endmarker as a base for your code instead and use '\n' for the end-marker.

What you received was 1.105331E-04\r\n; see e.g. http://www.asciitable.com/.

You might have to strip the '\r' but I think that atof() will ignore it.

Ah I see. So the Serial.Read converts the binary signal into ASCI terms?

Now I'll have to make a code that converts ASCI to string. Thank you so much!

So the Serial.Read converts the binary signal into ASCI terms?

No. Your RS232 device is sending ASCII.
Your second example looks like it attempts to assemble a string (char array) in receivedBytes, but it's looking for different end markers than are actually occurring.
It might be that your multimeter has multiple data transfer modes, and is not using the one that you expect.

po03087:
Now I'll have to make a code that converts ASCI to string. Thank you so much!

No, you do receive ascii. It's the way you printed the received data
* *(Serial.println(incomingByte, DEC);)* *
.

If you use Serial.write(incomingByte), you will see the text that the multimeter sends.