Sending image from Matlab via serial port and sending it back

Serial1 is not connected to the PC, but I am reading from Serial. Serial1 is just the 0-1 pins wired together, if something comes from the PC I write it to Serial1 and from there back to Serial.

The reieved data is the same as the transmitted, so its is good. I don't know where can I set up these handshaking methods ?