1,105,417 Community Members

serial port interfacing

Member Avatar
skyzone
Newbie Poster
1 post since Jan 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

hai...i'm a final year student, so i must finish my final project..my final project is serial port interfacing using visual basic 6.0...so i can't solve my problem to create a comm port setting..my output is led and this is also my problem because i can't run my program..anyone can help me for the coding...

Member Avatar
harry5341
Newbie Poster
5 posts since Mar 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hai...i'm a final year student, so i must finish my final project..my final project is serial port interfacing using visual basic 6.0...so i can't solve my problem to create a comm port setting..my output is led and this is also my problem because i can't run my program..anyone can help me for the coding...

I use vb6 serial port to key my ham radio. this is basically how i do it.
copy the mscomm1 component into you form, turn on rts and dts in the properties and use the following code as an example

i have the rts or dts pin go through a 510 ohm resister to an led and then the base of a 2n3904 transistor. pin 5 of the serial runs to radio ground. the emitter and the collector go across the radio key contacts. In you case you would go into the transistor via the 510 ohm resistor. you could use the 12 volts off the serial port or supply you own voltage via a wall wort through about a 1 or 2 k resistor to the led, out of the led to the transistor collector, and transistor emitter to ground, should work fine

Member Avatar
harry5341
Newbie Poster
5 posts since Mar 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

sorry...the code is
=====================
Private Sub Command1_Click()
If Text1 = "on" Then
Text1 = "off"
MSComm1.PortOpen = False

Else
Text1 = "on"
MSComm1.PortOpen = True

End If
End Sub

Member Avatar
Comatose
Taboo Programmer
2,536 posts since Dec 2004
Reputation Points: 290 [?]
Q&As Helped to Solve: 227 [?]
Skill Endorsements: 34 [?]
Team Colleague
 
0
 

If I'm not mistaken, though, harry5341, the mscomm control was obsoleted come (what was it, 2k?) when they removed the API calls for in and out calls of the port..... meaning that it won't work in windows 2k and above. If you are in 98 though, it should work fine.

Member Avatar
harry5341
Newbie Poster
5 posts since Mar 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

If I'm not mistaken, though, harry5341, the mscomm control was obsoleted come (what was it, 2k?) when they removed the API calls for in and out calls of the port..... meaning that it won't work in windows 2k and above. If you are in 98 though, it should work fine.

Yes mscomm is old, it still is used in VB6, What I need to come up with is a way of doing the same thing in vb2005. I know the serial port component is no longer mscomm but at this point that is about all I am sure of.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article