Rs232 Serial Port Communication

Active4 months ago

I have done serial port RS-232 connection in C++ using 16-bit compiler (I was using Turbo C++ IDE). It included header file bios.h which contain all the required functions for reading values from the port. Now I want to read value from serial port using C++ 32-bit Mingw compiler. I am using Dev CPP as my IDE. Here I could not find bios.h. Are there any special header files available for this purpose in Mingw? I am using 32-bit compiler now because in my college project I got to use Exception handling which I guess is not supported in Turbo C. Please help me out.

iammurtaza

Half duplex serial communication needs at a minimum two wires, signal ground and the data line. Full duplex serial communication needs at a minimum three wires, signal ground, transmit data line, and receive data line. The RS232 specification governs the physical and electrical characteristics of serial communications.

Rs232 Serial Port Communication

Usb To Rs232 Serial Port

iammurtaza

Understanding Rs232 Serial Port Communication

4122 gold badges9 silver badges26 bronze badges

Rs232 Serial To Usb

1 Answer

Please take a look here:

  • RS-232 for Linux and Windows1)
  • Windows Serial Port Programming2)
  • Using the Serial Ports in Visual C++3)

1)You can use this with Windows (incl. MinGW) as well as Linux. Alternative you can only use the code as an example.

Rs232 Serial Port Adapter

2)Step-by-step tutorial how to use serial ports on windows

3)You can use this literally on MinGW

Here's some very, very simple code (without any error handling or settings):

Now you can use WriteFile() / ReadFile() to write / read bytes.Don't forget to close your connection:

ollo

Serial Port Communication Using Rs232

ollo
20.5k11 gold badges84 silver badges136 bronze badges

Rs232 Serial Port Communication Software

Not the answer you're looking for? Browse other questions tagged c++serial-portmingw or ask your own question.