Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5205

Question for Ginny

From Martin <spam@spam.spam>
Newsgroups comp.lang.clipper.visual-objects
Subject Question for Ginny
Message-ID <Riqit.30557$a77.23623@fx18.fr7> (permalink)
Date 2013-05-08 12:04 +0100

Show all headers | View raw


Hello Ginny

I am testing out your comms library

Your sample does not error. But my code (based on yours) is getting 
error 87 SetCommState failed in SetProtcol. tested on 2 different PCs.

I am setting up the serial in a method then passing it back to the screen.

Any ideas please?

Thanks

Martin

METHOD StartComms	(nPort)			CLASS ScannerScreen

LOCAL oComm	AS Serial, ;
       oMain	AS MainWindow, ;
       nBaud	AS DWORD, ;
       nPar	AS BYTE, ;
       nLen	AS BYTE, ;
       nStop	AS BYTE, ;
       cErr	AS STRING, ;
       cPort	AS STRING, ;
       oComI	AS ComINI

cPort	:= 'Com'+Str(nPort,1)


oMain	:= SysObject()
oComI	:= oMain:ComINIFS

oComm	:= Serial{SELF:Handle()}
oComm:Open(cPort)
DO CASE
	CASE nPort = 1
		nBaud	:= oComI:Com1Baud
		nPar	:= oComI:Com1Par
		nLen	:= oComI:Com1Len
		nStop	:= oComI:Com1Stop
	CASE nPort = 2
.............
.............
ENDCASE

oComm:Baud		:= nBaud
oComm:Parity	:= nPar
oComm:ByteSize	:= nLen
oComm:StopBits	:= nStop

IF !oComm:SetProtocol()
	cErr	:= oComm:ErrorDesc
	Hit_Key('Unable to open '+cPort+CRLF+;
			'Error Text '+oComm:ErrorDesc+CRLF+;
			'Error Code '+oComm:ErrorCode,'Communication Setup Error')

	oComm:Close()
	BREAK
ENDIF
// Start receiving comm events in the MLE
oComm:EnableEvents(EV_RXCHAR)

RETURN oComm

Back to comp.lang.clipper.visual-objects | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Question for Ginny Martin <spam@spam.spam> - 2013-05-08 12:04 +0100
  Re: Question for Ginny Martin <spam@spam.spam> - 2013-05-08 12:15 +0100
    Re: Question for Ginny "Ginny Caughey" <gcaughey@online.hotmail.com> - 2013-05-09 07:13 -0400
      Re: Question for Ginny Martin <spam@spam.spam> - 2013-05-10 14:16 +0100

csiph-web