I don't see port initialisation in your code.
For you serial port parameters:
- The
word size is missing the value is usually 7 or 8 bits.
- and this is not traditional parameter.
Quote:
Parity Replace 63
If the printer gives you an answer for your message, you have to wait for the answer, serial communication is slow.
You should replace your printer with a computer with terminal emulation in order to see what your printer is receiving.
Back in the time of DOS, I was using a special software named "Breakout" with a special cable enabling to spy the bi-directional communication, including signals.
Look at printer manual to ensure you are using the right com parameters.