ELEXS.pbi
Ich weiß da sind doubles drin, macht hier aber hoffe ich mal nichts:ELEXS.dll
OPENCOM 1
TIMEOUTS 1
CLOSECOM 0
SENDBYTE 1
READBYTE 0
DTR 1
RTS 1
TXD 1
GETCOM 0
CTS 0
DSR 0
RI 0
DCD 0
INPUTS 0
TIMEINIT 0
TIMEREAD 0
DELAY 1
REALTIME 0
NORMALTIME 0
Mein Code:Declare Function OPENCOM Lib "ELEXS" (ByVal OpenString$) As Integer
Declare Sub TIMEOUTS Lib "ELEXS" (ByVal b%)
Declare Sub CLOSECOM Lib "ELEXS" ()
Declare Sub SENDBYTE Lib "ELEXS" (ByVal Dat%)
Declare Function READBYTE Lib "ELEXS" () As Integer
Declare Sub DTR Lib "ELEXS" (ByVal b%)
Declare Sub RTS Lib "ELEXS" (ByVal b%)
Declare Sub TXD Lib "ELEXS" (ByVal b%)
Declare Function GETCOM Lib "ELEXS" () As Integer
Declare Function CTS Lib "ELEXS" () As Integer
Declare Function DSR Lib "ELEXS" () As Integer
Declare Function RI Lib "ELEXS" () As Integer
Declare Function DCD Lib "ELEXS" () As Integer
Declare Function INPUTS Lib "ELEXS" () As Integer
Declare Sub TIMEINIT Lib "ELEXS" ()
Declare Function TIMEREAD Lib "ELEXS" () As Double
Declare Sub DELAY Lib "ELEXS" (ByVal ms As Double)
Declare Sub REALTIME Lib "ELEXS" ()
Declare Sub NORMALTIME Lib "ELEXS" ()
Code: Alles auswählen
HCom = opencom_("COM1:")
If HCom > 0
#WindowWidth = 300
#WindowHeight = 80
#WindowFlags = #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered | #PB_Window_SystemMenu
hWnd = OpenWindow(0, 0, 0, #WindowWidth, #WindowHeight, #WindowFlags, "")
CreateStatusBar(0, WindowID())
AddStatusBarField(#WindowWidth)
TIMEINIT_()
RTS_(1)
DTR_(1)
TXD_(0)
Repeat
DTR_(1)
TIMEINIT_()
While (DSR_() = 0) And (TIMEREAD_() < 2001)
WindowEvent()
Wend
StatusBarText(0, 0, Str(TIMEREAD_()))
DTR_(0)
Until Quit = 1
CloseCom_()
EndIf
End