laatzen/Pruef2000/source/Module1.bas
2021-10-01 11:11:04 +02:00

35 lines
563 B
QBasic

Attribute VB_Name = "Module1"
Option Explicit
Public Sub Com_open()
Form1.MSComm1.CommPort = 1
Form1.MSComm1.Settings = "1200,O,7,1"
Form1.MSComm1.InputLen = 0
Form1.MSComm1.PortOpen = True
If Err Then
MsgBox ("Fehler beim Öffnen des COM Ports")
End If
End Sub
Public Sub Com_close()
Form1.MSComm1.PortOpen = False
End Sub
Public Function Com_receive()
Dim instring As String
Do
instring = instring & Form1.MSComm1.Input
DoEvents
If Right(instring, 1) = Chr(13) Then
Exit Do
End If
Loop
End Function