----------
Custom Search

Wednesday, February 25, 2009

How to use Serial Port (mscomm32.ocx)

Use mscomm32.ocx. (Com1 - Com16 only)

1. Register to your library
-> locate at windows\system32
-> if not available download it from the web then copy to windows\system32
-> type at run - regsvr32 c:\windows\system32\mscomm32.dll

2. By using vb6
-> Right Click Tools -> Add Component
-> Scroll Down and Check Microsoft Communication Control
-> A Telephone image will be added on your tools

3. By using foxpro
-> At Tools Choose OLE -> Add object -> Form will pop-up
-> Choose Insert Control -> Scroll Down -> Add Microsoft Communication Control

4. Initialize Mscomm32
-> right click OLE -> Properties -> Enter Commport, Settings, Etc..

5. Send data
-> if mscomm.portopen=false then
-> mscomm.portopen=true
-> end if
-> mscomm.output="Message"
-> mscomm.portopen=false

6. Recieve Data
-> if mscomm.portopen=false then
-> mscomm.portopen=true
-> end if
-> message=mscomm.input
-> mscomm.portopen=false

No comments:

Post a Comment