Advertisement

08.11.2008 at 01:27PM PDT, ID: 23639283 | Points: 125
[x]
Attachment Details

Mscomm receiving problem

Asked by frozenviolet in VB Controls, Visual Basic Programming, Networking Cables

Tags: ,

Hey, guys

I'm totally new on VB and was really confused by the Mscomm control.

My program is very simple. A system need to trigger the computer through the rs232 port. So my program on VB is just using the Mscomm to detect if there has some data received.

I'v tried the InBuffercount>0, but even I found something received, the InBuffercount still equals zero.

On the other hand, when I use the
Select Case MSComm1.CommEvent
Case comEvReceive
the comEvReceive was flagged as not declared.

It maybe a stupid question because the program seems very easy. But none of these option works. Can anyone help me? I really don't know what I can do now.


my code is:
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
 
mintCount = 0
Timer1.Enabled = True
 
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
 
mintcount = mintcount + 1
TextBox2.Text = mintcount
MSComm1.CommPort = 1
MSComm1.PortOpen = True
If MSComm1.OutBufferCount >0 Then
MsgBox("dg")
Timer1.Enabled = Falses 
End If
TextBox3.Text = MSComm1.OutBufferCount
MSComm1.PortOpen = False
End Sub
 
Loading Advertisement...
 
[+][-]08.12.2008 at 01:40AM PDT, ID: 22210977

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.16.2008 at 07:38PM PDT, ID: 22495045

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628