06-29-2021 04:06 AM
how to read the same data that is written to the COMport.
06-29-2021 04:37 AM
Please open a new thread. Probably your question has nothing to do with this old post.
What you mean exactly? Please give details: do you want to read with what: another program? another computer? ...?
06-29-2021 04:43 AM
How to write data to the COM port? And also I want to read the same data from it.(which I write to the COM port)
06-29-2021 05:01 AM
@Parvathiiii ha scritto:
And also I want to read the same data from it.(which I write to the COM port)
What's the point in doing this? This is nearly nonsensical. You already know what you wrote.
If you insist, you can put a loopback on the serial connector. If the serial port is a two wire RS-485, you even don't need the loopback.
06-29-2021 06:51 AM
As already stated, if using RS232 or RS422, you need a loopback on your port. For RS323, this means you wire pin 2 to pin 3. What I typically do for testing a serial port is to use 2 ports with a crossover cable between them. Then when I write on one port, I can read on the other.
06-29-2021 09:24 AM
Or you can use a null modem emulator, such as com0com
06-29-2021 09:37 AM
Start here:
How to Perform a Serial Loopback Test
Also watch this video before you begin ANY serial communications programming:
VIWeek 2020/Proper way to communicate over serial