×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Serial port communication using MSComm control.

Serial port communication using MSComm control.

Serial port communication using MSComm control.

(OP)
I'm trying to pass simple text strings between two computers using a null modem cable. I can't seem to get any response. I'm using the MSComm control and the OnComm event does not seem to be triggered. Any ideas?

RE: Serial port communication using MSComm control.

What oncomm event are you trying to use. If you code is small enough, put it in a reply for me to look at.

RE: Serial port communication using MSComm control.

(OP)
I'm looking for the comEvReceive event. I have set the RThreshold to 1, which I understand should trigger the OnComm event for each byte of information that is coming in.

I set these properties on form load: (for both apps)
commport = 2
settings = 1200,n,7,1
portopen = true

Heres some code I use to prepare and send the string. Any ideas to what I'm missing? When I send the string to the other computer (with an app much the same) the string doesn't seem to be received(OnComm not triggered.)

Thank you for your help.

Private Sub cmdSend_Click()

Dim outstring As String
outstring = Chr(StartStr)& ":" & "TE" & ":" & "ST" & ":" & Chr(EndStr)
txtReceived.Text = outstring
SendString outstring

End Sub

Function SendString(InString As String) As Boolean

MSComm1.Output = InString

End Function

RE: Serial port communication using MSComm control.

Private Sub cmdSend_Click()

Dim outstring As String
outstring = Chr(StartStr)& ":" & "TE" & ":" & "ST" & ":" & Chr(EndStr)
txtReceived.Text = outstring
MSCOMM1.output = outstring
'SendString outstring

The only thing I can suggest right now is to move the mscomm1.output command out of the function for testing. Just to make sure.

RE: Serial port communication using MSComm control.

(OP)
I'll try that.
Thanks for all your help :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close