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.

Need Help for using Visual Basic 6 with Serial Port

Status
Not open for further replies.

sanjay

Full Member level 1
Joined
Jul 4, 2003
Messages
98
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,012
set objcomm = createobject (mscommlib.mscomm)

Hi there,

I am sort of used to Visual Basic 6 and need information..or some documents that can provide some knowledge or some examples on using Visual Basic 6 and programming in it for Serial Ports.

I know how to do it in Java but want to know in Visual Basic 6
I know you can do it trhough MSComm 6
but need some examples of already done stuff

Help would be appreciated

Thanks
 

hai,

in MSDN,u got sample file mscomm

from that u learn lot of it

bye
 

code snippet:

Private Function MakeString(v As Variant) As String
Dim t As String
t = ""
For i = 0 To UBound(v)
t = t & Chr(v(i))
Next i
MakeString = t
End Function


Set objComm = CreateObject("MSCOMMLib.MSComm.1")

objComm.CommPort = iPortNo
objComm.Settings = "38400,n,8,1"
objComm.Handshaking = 0
objComm.InputLen = 0
objComm.InBufferSize = 512
objComm.InputMode = 1
objComm.NullDiscard = False
objComm.DTREnable = False
objComm.RTSEnable = False
objComm.EOFEnable = False
objComm.RThreshold = 10 ' useless, events will not be fired
objComm.PortOpen = True

objComm.Output = "?"

lCount = 0
Do
SleepEx 10, False
lCount = lCount + 1
Loop Until (objComm.InBufferCount > 20) Or (lCount > WAIT_COUNT)

msResult = MakeString(objComm.input)

hope this will help

greetings from Germany
 

Thank you guys for all the help..
Is there any site where one can find projects to practice and get their hands dirty on just to get the idea of this stuff
 

Hi,

Many issues of EPE magazines covered this topic search the ebooks about How can you download EPE Magazine.

Bye
 

yeah thank you guys for the information posted. It did help a lot .

Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top