Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Missing CHR(3) in buffer, pls help
Message
De
11/01/2004 22:31:58
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Missing CHR(3) in buffer, pls help
Divers
Thread ID:
00865892
Message ID:
00865892
Vues:
54
Hi,

My VFP6 written application is using MSCOMM control for communicating with a external device running at 14400,N,8,1 parameter.

When I expect some large return of inbuffer like 89 bytes in size, I always miss out the
ETX character.

But this does not happened when the return of inbuffer is around 50 bytes in size.
Below are part of my code.

Why, any one can assist or advise me. Thank you


FUNCTION OpenPort
WITH THISFORM.MSCOMM

.Settings='14400,N,8,1'
.OutbufferSize=512
.InBufferSize=1024
.Handshaking=1 * Xon/Xoff handshaking
.PortOpen = .T.

.RThreshold = 1
.InputLen = 0
.InBufferCount = 0
.OutBufferCount = 0

ENDWITH
ENDFUNC


OnComm Events
IF THIS.InbufferCount >= 1

cChar = ""
cChar = THIS.INPUT

IF cChar $ CHR(3)
WFile("ETX detected")
ENDIF

THISFORM.cBuffer = THISFORM.cBuffer + cChar

THISFORM.WFile("Buffer = "+THISFORM.CBuffer+", Len = "+ALLT(STR(LEN(THISFORM.CBuffer))))

ENDIF
Best Regards
Virusim
Répondre
Fil
Voir

Click here to load this message in the networking platform