1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Option Explicit
Private Sub Form_Load()
Form1.Caption = "App1"
With MSComm1 'configuration du port
.CommPort = 1 'On utilise le port COM1:
.Handshaking = 2 'RTS
.RThreshold = 1
.RTSEnable = True 'mieux pour le port COM:
.Settings = "9600,n,8,1"
.SThreshold = 1
.PortOpen = True 'ouverture du port
End With
Command1.Caption = "&Send"
Text1.Text = "0"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False 'on ferme le port à la fermeture de l'appli
End Sub
Private Sub Text1_Change()
MSComm1.Output = Text1.Text
End Sub |
Partager