In any case, I'd suggest you start on a computer with an RS-232 port and a [u]terminal application[/u]. That will allow you to "manually" send one command at a time (and receive if your pump transmits). That will allow you to confirm the RS-232 configuration (including handshaking, etc). before you try to program anything.
Do as DVDdoug wrote, test it with a computer. Then you know that it is working, and you get some 'feeling' how the device works.
Please connect the device to Serial1, Serial2 or Serial3. That way you can still communicate with the Arduino Mega 2560 via the serial monitor (of the Arduino IDE) and you can still upload sketches.
The next test could be the Arduino in between, and a sketch that transfers from the serial monitor to the device in both directions. Start with the simple "ver" and "status" commands.
The next test is the Arduino sending those commands, and show the result to the serial monitor.
The Arduino Leonardo and Micro have also a spare hardware serial port. You can use those boards as well, if you want a smaller board someday.
The RS-232-to-ttl modules are sometimes very confusing. Some manufacturers exchange RX and TX, or use inverted RX and TX signals. Some devices use 0V for the low level which is not always compatible with the RS-232-to-ttl modules.
The Arduino RX is the input of the Arduino board, the TX is the output of the Arduino board, and the signal is idle high.
PHD Ultra device:
9600...921600 baud. Because of the crystal of 16MHz of the Arduino Mega board, the baudrate is not very precise. Use 9600 for testing.
You use Serial.println(), that prints an extra LineFeed (or was it CarriageReturn + LineFeed ?). According to the documentation, that is not needed.
DVDdoug:
Medical??? Something involving people's lives or health??? Are you a doctor, or are you just nuts!
How about just an RS-232 port for your computer?
In any case, I'd suggest you start on a computer with an RS-232 port and a [u]terminal application[/u]. That will allow you to "manually" send one command at a time (and receive if your pump transmits). That will allow you to confirm the RS-232 configuration (including handshaking, etc). before you try to program anything.
Something involving living cells and hydrogels.
I tried to communicate with the pump and computer through matlab program using USB connection and it worked. But the same process never work when the arduino is in between. I don't have access to a computer with RS232 serial port though. Is there anything else I can do?
Tell us which RS-232-to-ttl module you have. Can you give a link to it ?
Connect it to Serial1. Make a sketch that passes data from one to the other. Type the command in the serial monitor and try to exchange the RX and TX of the RS-232-to-ttl module.