The serial port write only accepts strings, so to send 5000 in ASCII Hex, use the backslash character. So 5000 would become \35\30\30\30. This will send the hex numbers 35, 30, 30, 30 rather than the ASCII for 3, 5, 3, 0, ... This should help. Give it a try.
Rob