Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing CHR(3) in buffer, pls help
Message
From
11/01/2004 22:31:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Missing CHR(3) in buffer, pls help
Miscellaneous
Thread ID:
00865892
Message ID:
00865892
Views:
57
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
Reply
Map
View

Click here to load this message in the networking platform