COM1 vb

pinieros

Board Regular
Joined
Dec 21, 2004
Messages
59
Hi board!
I am using the following code in VB to test the com1 hardware.
The problem is that it works great in debug mode but noy in RUN mode
I am using a jumper on pins 2&3 of the com1

Private Sub Option1_Click()
If Option1.Value = True Then
If Label1.Caption = "Com1 OK" Then Label1.Caption = ""
If Label1.Caption = "Com2 OK" Then Label1.Caption = ""
If Label1.Caption = "Com3 OK" Then Label1.Caption = ""
If Label1.Caption = "Com4 OK" Then Label1.Caption = ""
MSComm1.CommPort = 1
MSComm1.PortOpen = True
MSComm1.Output = Chr(d)
If MSComm1.Input = Chr(d) Then
Label1.Caption = "Com1 OK"
Else: MsgBox "Error on COM1", vbCritical, "Caution"
Picture2.Visible = True
End If
End If
MSComm1.PortOpen = False
End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,847
Messages
6,181,325
Members
453,032
Latest member
Pauh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top