Private Sub Form_Load()
 i = OPENCOM("COM1:1200,N,8,1")
 If i = 0 Then
    i = OPENCOM("COM2:1200,N,8,1:")
    Option2.Value = True
 End If
 If i = 0 Then MsgBox ("Schnittstelle nicht verfgbar")
 RTS 1
End Sub
Private Sub Form_Unload(Cancel As Integer)
  Ausgabe = False
  CLOSECOM
End Sub

Private Sub Option1_Click()
 i = OPENCOM("COM1:1200,N,8,1")
 If i = 0 Then MsgBox ("COM1 nicht verfgbar")
 RTS 1
End Sub

Private Sub Option2_Click()
 i = OPENCOM("COM2:1200,N,8,1")
 If i = 0 Then MsgBox ("COM2 nicht verfgbar")
 RTS 1
End Sub

Private Sub Timer1_Timer()
  freq = 0
  alt = CTS()
  REALTIME
  TIMEINIT
  While (TIMEREAD < 100) And (CTS() = 1)
  Wend
  TIMEINIT
  While (TIMEREAD < 100) And (CTS() = 0)
  Wend
  TIMEINIT
  While (TIMEREAD < 100) And (CTS() = 1)
  Wend
  Puls = TIMEREAD
  NORMALTIME
  If Puls > 100 Then Puls = 0
  Puls = Int(Puls * 1000) / 1000
  Text1.Text = Str$(Puls) + " ms"
End Sub
