Forums

RS232 VB6 HELP!

Started by electro April 3, 2006
i have a microcontroller which i want to interface to my PC thorugh VB
using the rs232 connection..
i wish to use the RTS/CTS as well as the DTR signal pins from the
rs232..
1.RTS will be used to simply reset/start the microconotroller
application(rs232 output) through a port input pinof the mcu
2.CTS will be used to simply indicate the level of a certain mcu output
pin after starting the mcu application..
3.DTR will be used to toggle(RS232 toutput) another mcu input pin.

can i humbly ask for your simple coding template for this setup?thanks
so much.........

electro wrote:
> i have a microcontroller which i want to interface to my PC thorugh VB > using the rs232 connection.. > i wish to use the RTS/CTS as well as the DTR signal pins from the > rs232.. > 1.RTS will be used to simply reset/start the microconotroller > application(rs232 output) through a port input pinof the mcu > 2.CTS will be used to simply indicate the level of a certain mcu output > pin after starting the mcu application.. > 3.DTR will be used to toggle(RS232 toutput) another mcu input pin. > > can i humbly ask for your simple coding template for this setup?thanks > so much......... >
just google VB6 + RS232 (also search in the google "groups" options). Jamie
With VB6 the surest way to get the MSCOMM ActiveX control is to get VB6
Enterprise or Professional edition. 

Any other version of VB6 or Excel you will have to 
1. obtain MSCOMM32x.ocx somewhere (try www.zaber.com)
2. register it on your PC: 
Start button | Run | and enter "regsvr32 mscomm32.ocx" (without the
quotes
3. Follow the instructions at this URL

http://archive.chipcenter.com/eexpert/rashby/rashby057.html

Once you have it, the help files in VB6 will provide some help. The zaber
web site also has quite a bit

Good books to help with this:
"Serial Port Complete" by Jan Axelson
"Visual Basic Programmer's Guide to Serial Communications" by Richard
Grier

and dare I say it, my own book has a section detailing the above and how
to use serial comms within Microsoft Excel which is no different to
regular VB6.
"Excel by Example: A Microsoft Excel Cookbook for Electronics Engineers"
by Aubrey Kagan

By the way Visual Basic 2005 Express is avaiable for free
(http://msdn.microsoft.com/vstudio/express/vb/default.aspx) and includes a
serial port control. It is however different to mscomm32 and you will have
to reply on the help files.

I hope this is of some help
-Aubrey Kagan

thanks!

>thanks! > >
I also just remembered this article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingcommunicationscontrol.asp -Aubrey