This is a short lesson or tutorial on the development of your own application program for computer to send and recive data from microcontroller (any, the microcontroller side program is not discussed here).
What you need is written in steps;
Step # 1:
You need a computer with visual basic 6 plat form installed on it.
Open the VB6 application from programs to write a code.
You will notice following message on screen, choose Standard exe and press OK,( This is default)
Here a form is open, you will need to add a component required for serial communication. Normally it is not visible in tools and we have to bring it in tools from components. This VB6 library built in.
1. right click on the bar of tools available for you to use on left side of the application and press add components. OR
2. Press control+T to open the component window OR
3. Go to project menu and click on components
By using either way , you will open the component window as shown below.
Now Find "Microsoft comm control 6" and check the option and press "OK"
Place the texts boxes and command buttons by drag and drop method from tool bar. Resize them. and make the form as shown in the figure below.
Dim strInBuff as String ' The incoming data from the serial port will be stored in this string
Private Sub Form_Load()
.CommPort = 1
.RThreshold = 1
.RTSEnable = True
.Settings = "9600,N,8,1"
.InputLen = 127
.SThreshold = 1
' .PortOpen = True
temp1 = 100 ' You can declar and use as many varaible whose value is required to send from ' 'PC but here as only one is required , so i have declared only one.
Private Sub MSComm1_OnComm()
' Different events are occured , when data come , these includes some errors also (if they occur in communication, but normally RS-232 have not problems)
Select Case MSComm1.CommEvent
' The data (incoming from outside world to PC through RS-232 port is stored in
strInBuff = MSComm1.Input
MSComm1.Input = ""
Text1.text = strInBuff ' what ever we get is displayed in a text
MSComm1.Output = Chr$(temp1)
MSComm1.PortOpen = True
MSComm1.PortOpen = False
Private Sub Form_Unload(Cancel As Integer)
other post on the topic of serial communication are given below.Students can look on them for further informaion.
1. Programmable Frequency meter
In Windows-95, win-98, window-Me, win-NT, and windows 2K & XP have Hyper-Terminal built in program. The prime object of HyperTerminal is have serial communication either through RS-232 port or modem.
The RS232 circuit diagram is provided.
4. Serial Interfacing of Microcontroller 8051 in Automatic Car Parking Project
5. Introduction of serial Port RS-232--part1-4
Tags:-example code of sending data from at89s51 to serial port,the data transfer must be by a specific serial channel 8051 Project,Send data to COM port and analyze reaction of the serial device 8051 projects,Serial Port Monitor Software -uart at89c51 Serial Monitor - AT89C51 serial to communication a bar code RS232 Port ADC0804,12 MHz crystal with AT89C51 and want to send and receive data from serial port,The Micro Stop - RS232 and microcontroller schematics and C code ,microcontroller projects, at89c51 projects, 8051 serial port communication,How to send number through rs232 to AT89C51,serial port programming in c,Interfacing Serial Port (RS232) with 8051 microcontroller AT89C51.,Project also describe serial port interfacing circuit and code in C.AT89C51 microcontroller can be set to transfer and receive serial data,serial communication in AT89c51,serial port is ready to transmit a new character,send data correctly into SBUF ,Send data on a serial port ,code to read data from Serial Port of Com port,Sending ASCII Code For At89c51 ,Serial Port Communication With PIC microcontroller,Communicate Through The Serial Port(com1) Communicate VB With External Buttons Using Serial Port Using Existing C Source Code To Communicate Via Serial Port Send Text File To Serial Port To Communicate With A 8051 Embeded Device. Transmit From Serial Comm To Microcontroller Connecting a microcontroller to RS-232 ports and PS/2 devices Serial Reception Of Data From Modem With Atmel89C51 Microcontroller How To Communicate With USB Port.How To Communicate With COM Port? How Do You Communicate Through The IrDA Port? Communicate Directly With PS/2 Or Other Port Communicate With Hradware Port Communicate Directly With PS/2 Or Other Port communicate With Printer Through COM Port How To Make VB Communicate With A Com Port Of Ur Pc Program To Communicate With USB Port Communicate Through Parallel Port How Do I Communicate With A Modem Or With A Com Port? How To Communicate With Parallel Port Using VB.NET? Problem With Reading Data From Com Port(serial Port) Read Data From Serial Port Or COM Port Serial Port Emulator / Virtual Com Port How To Get Data From Serial Port /parallel Port Get Info From Serial Port (mouse Port) Is There Any Controls Of USB Port? Like MSComm To Serial Port. RS232 & Microcontroller Communication 8051 interfacing tutorials with RS232 logic devices with circuit Interfacing Serial Port RS232 with 8051 microcontroller AT89C51,Microcontroller with RS232 and GSM,Basic USB-RS232 Communication with PIC Microcontrollers,Interfacing The Serial / RS-232 Port,RS232 and Microcontroller 80s52, Interfacing a Microcontroller With a PC Using RS232 ,USB-to-RS232 Hurdle Race ,Serial Port PIC Microcontroller Programmer