1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| Dim DSRancien, Compteur1
Private Sub Form_Load()
i = OPENCOM("COM2,1200,N,8,1")
If i = 0 Then
i = OPENCOM("COM1,1200,N,8,1")
Option1.Value = True
End If
If i = 0 Then MsgBox ("Pas d'interface disponible")
TXD 1
RTS 1
DTR 1
Compteur1 = 0
DSRancien = DSR()
Timer1.Interval = 20
Text3 = "0"
Text4 = "0"
End Sub
Private Sub Form_Unload(Cancel As Integer)
CLOSECOM
End Sub
Private Sub Option1_Click()
i = OPENCOM("COM1,1200,N,8,1")
If i = 0 Then MsgBox ("COM1 indisponible")
TXD 1
RTS 1
DTR 1
End Sub
Private Sub Option2_Click()
i = OPENCOM("COM2,1200,N,8,1")
If i = 0 Then MsgBox ("COM2 indisponible")
TXD 1
RTS 1
DTR 1
End Sub
Private Sub Timer3_Timer()
Text3 = Text3 + 1
End Sub
Private Sub Timer1_Timer()
DSRnouveau = DSR()
If DSRnouveau > DSRancien Then
Compteur1 = Compteur1 + 1
Text5 = Text3
Text3 = 0
Label1.Caption = Str$(Compteur1)
Label2.Caption = Str$(60 / Text5)
End If
DSRancien = DSRnouveau
End Sub
Private Sub Timer2_Timer()
temps = Time()
Text1.Text = temps
End Sub
Private Sub Timer4_Timer()
Text4 = TIMEREAD()
End Sub
Private Sub Text5_Change()
Text6 = Text4
End Sub |
Partager