Code: Alles auswählen
DeclareDLL ResetDTR(hCom.l)
DeclareDLL SetDTR(hCom.l)
DeclareDLL ResetRTS(hCom.l)
DeclareDLL SetRTS(hCom.l)
DeclareDLL ResetTXD(hCom)
DeclareDLL SetTXD(hCom.l)
DeclareDLL.l GetCTS(hCom.l)
DeclareDLL.l GetDSR(hCom.l)
DeclareDLL.l GetRING(hCom.l)
DeclareDLL.l GetRLSD(hCom.l)
DeclareDLL SendChar(hCom.l, Wert.l)
DeclareDLL.l ReadChar(hCom.l)
DeclareDLL.l OpenCom(Nr.l, Baud.l, Bits.b, Stop.b, Parity.b)
DeclareDLL CloseCom(hCom.l)
ProcedureDLL LoadCom1()
;DTR = -/+5V (out)
;CTS = +5V (in) [Ergebnis: 0=off(0V), 1=on(+5V)
;RTS = -/+5V (out)
Structure ComDCB
DCBlength.l
BaudRate.l
fBinary.l
fParity.l
fOutxCtsFlow.l
fOutxDsrFlow.l
fDtrControl.l
fDsrSensitivity.l
fTXContinueOnXoff.l
fOutX.l
fInX.l
fErrorChar.l
fNull.l
fRtsControl.l
fAbortOnError.l
fDummy2.l
wReserved.w
XonLim.w
XoffLim.w
ByteSize.b
Parity.b
StopBits.b
XonChar.b
XoffChar.b
ErrorChar.b
EofChar.b
EvtChar.b
wReserved1.w
EndStructure
Name.s = "Com1"
hCom.l = OpenCom(1,19200,8,#ONESTOPBIT, #NOPARITY)
If hCom > #INVALID_HANDLE_VALUE
;Delay(1000)
;ResetDTR(hCom)
;SetRTS(hCom)
;Delay(1000)
;ResetRTS(hCom)
;Delay(1000)
;SetDTR(hCom)
;Delay(1000)
EndIf
EndProcedure
MfG