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?
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.<br>
<br>
I set these properties on form load: (for both apps)<br>
commport = 2<br>
settings = 1200,n,7,1<br>
portopen = true <br>
<br>
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.) <br>
<br>
Thank you for your help. <br>
<br>
Private Sub cmdSend_Click()<br>
<br>
Dim outstring As String<br>
outstring = Chr(StartStr)& ":" & "TE" & ":" & "ST" & ":" & Chr(EndStr)<br>
txtReceived.Text = outstring<br>
SendString outstring<br>
<br>
End Sub<br>
<br>
Function SendString(InString As String) As Boolean<br>
<br>
MSComm1.Output = InString<br>
<br>
End Function<br>
Private Sub cmdSend_Click()<br>
<br>
Dim outstring As String<br>
outstring = Chr(StartStr)& ":" & "TE" & ":" & "ST" & ":" & Chr(EndStr)<br>
txtReceived.Text = outstring<br>
MSCOMM1.output = outstring<br>
'SendString outstring<br>
<br>
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.<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.