Serial Port Communication

A serial port interface is a Graphical User Interface program that runs on a computer and can be used to connect to the devices with a microcontroller and the same hardware device.

In this article, I am going to describe this step by step with a screenshot and source code.
 
Prerequisites
  • Visual Studio IDE to develop the code
  • System with Serial Port communication (comport or USB) for transmitting and receiving the data.
  • Terminal software for testing.
Serial Port Communication
 
Code and explanation
  • The above screenshot is the user interface for Serial Communication 
  • The first combobox is used to select the com ports from the available ports and the Connect button is used to establish the local machine into the hardware via a communication cable.
  • Transmit data textbox area is to enter what we have to transmit, and a send button is used to transmit the data.
  • Receive textbox area for receiving the data from the receiver.
  • Status textbox is  used to display current application status to the user.
  • For testing you can useTerminal software; it's freely available, and you can download it from the below link.
  • The source code is attached here with comments. If you need any clarification please comment.