I'm trying to setup half duplex communication in Windows10 in my program. I have my USB connected to COM3 which is converted to a RS485 connection using a converter. Most of the available information out there are using Linux systems which does not work in Windows. How do I send and receive data from the COM port to the hardware connected by RS485?
Asked
Active
Viewed 1,425 times
1
-
[how to send/receive data through a windows com port](https://stackoverflow.com/questions/25013935/c-program-to-send-and-receive-serialuart-data-using-com-ports) Of course, it matters which bus wire is connected to which i/o pin of the adapter – user3629249 Jun 27 '20 at 18:24
-
1Your COM port with RS-485 adapter will be in receive mode unless your program tries to transmit data. That's the simple scheme. The crux is respecting the time when your node (either the master or a slave) can transmit and when it should not transmit. That's defined by an upper-layer protocol, not RS-485. – sawdust Jun 27 '20 at 18:49
-
It will depend on the specifications of the device driver for your adapter. Please check by obtaining the documentation or SDK from the adapter vendor. For example, in this vendor's model, in Linux, specify different device files for each mode of 232/422/485-2w/485-4w, and in Windows, switch the mode with the control panel with the same one COM port. [UPort 1200/1400/1600 Series User's Manual](https://www.moxa.com/getmedia/1e6a0c61-4601-4a89-9457-f86c5bc01ff7/moxa-uport-1000-series-uport-1200-1400-1600-series-manual-v8.1.pdf) – kunif Jun 28 '20 at 23:02