I have a small problem with setting up my comm port....
I use a USB to Serial adapter and connect to a medical device to read its data and all works fine if I use comm ports 1 to 9.
If I try to use a higher comm port (10+) I get a SetCommState error.
- Code: Select all Expand view
nComm:= OpenComm( "Com"+alltrim(str(Config->Comm)), 1024, 128 )
if ! BuildCommDcb( "COM"+alltrim(str(Config->Comm))+":9600,n,8,1", @cDcb )
MsgInfo("BuildComm Error")
oDlg1:End()
lError := .t.
RETURN NIL
endif
if ! SetCommState( nComm, cDcb )
MsgInfo("SetComm Error")
oDlg1:End()
lError := .t.
RETURN NIL
endif
if FlushComm( nComm, 1 ) != 0
MsgInfo("FlushComm Error")
oDlg1:End()
lError := .t.
RETURN NIL
endif
Anyone know why this is happening?