Ich hab hier ein Programm, kann mir vielleicht einer den Aufbau und die genaue funktion dieses Programmes erklären
I
Bin für jede Erklärung dankbar, je ausführlicher desto besser
Das Programm
Das Modul:
I
Bin für jede Erklärung dankbar, je ausführlicher desto besser
Das Programm
Code:
Dim Zeit As Integer
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 ("Schnittstelle nicht verfügbar")
TXD 1
RTS 0
DTR 0
Zeit = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
CLOSECOM
End Sub
Private Sub HScroll1_Change()
Timer1.Interval = HScroll1.Value
End Sub
Private Sub Option1_Click()
i = OPENCOM("COM1,1200,N,8,1")
If i = 0 Then MsgBox ("COM1 nicht verfügbar")
TXD 1
RTS 0
DTR 0
End Sub
Private Sub Option2_Click()
i = OPENCOM("COM2,1200,N,8,1")
If i = 0 Then MsgBox ("COM2 nicht verfügbar")
TXD 1
RTS 0
DTR 0
End Sub
Private Sub Timer1_Timer()
Zeit = Zeit + 1
If Zeit = 1 Then
RTS 1
DTR 0
End If
If Zeit = 2 Then
RTS 0
DTR 1
End If
If Zeit = 2 Then Zeit = 0
End Sub
Das Modul:
Code:
Declare Function OPENCOM Lib "Port" (ByVal A$) As Integer
Declare Sub CLOSECOM Lib "Port" ()
Declare Sub SENDBYTE Lib "Port" (ByVal b%)
Declare Function READBYTE Lib "Port" () As Integer
Declare Sub DTR Lib "Port" (ByVal b%)
Declare Sub RTS Lib "Port" (ByVal b%)
Declare Sub TXD Lib "Port" (ByVal b%)
Declare Function CTS Lib "Port" () As Integer
Declare Function DSR Lib "Port" () As Integer
Declare Function RI Lib "Port" () As Integer
Declare Function DCD Lib "Port" () As Integer
Declare Sub DELAY Lib "Port" (ByVal b%)
Declare Sub TIMEINIT Lib "Port" ()
Declare Sub TIMEINITUS Lib "Port" ()
Declare Function TIMEREAD Lib "Port" () As Long
Declare Function TIMEREADUS Lib "Port" () As Long
Declare Sub DELAYUS Lib "Port" (ByVal l As Long)
Declare Sub REALTIME Lib "Port" (ByVal i As Boolean)