Quote:The code is compiling but there is no data received.
I fear your problem is that serial port is slooow, but you close the port immediately after sending your data.
You need to keep the port open to give it a chance to receive data from logger.
Since serial port is slow, the handler will be called as data is still coming from logger, before answer is complete.
It is a bad idea to have the handler messing with console and waiting for user input.
Tutos about serial port are available on internet, you need to study the serial port principles because you have another problem, your prograzm is finished before receiving the answer.
Your problem is not just the code to receive data, it is the whole program.