Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Rs232 communication in vb6 for sending a byte to the microcontroller

Status
Not open for further replies.

vinkad999

Newbie level 5
Joined
Feb 11, 2012
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,354
Hi,I am Vinod.I need to send the command from pc using visual basic 6 to the atmega 32 microconyroller.So i need to prepare the GUI for that.So how to do it using vb6 through rs232 i need the code for the data transfer.The data is DE801234[32 BIT COOMAND].
 

if u could use vb2010, try this


Private mySerialPort As New SerialPort

Dim var(4) As Byte={&HDE, &H80, &H12, &H34}

With mySerialPort
.PortName = "COM9"
.BaudRate = 9600
.DataBits = 8
.Parity = Parity.None
.StopBits = StopBits.One
.Handshake = Handshake.None
End With
Try
mySerialPort.Open()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
mySerialPort.Write(var, 0, 4)
mySerialPort.Close()
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top