Thanks Jim and Cetin
One thing I have discovered is that the sending device is putting large numbers of NULL characters 0x00 into the serial stream. If I trap them out when processing the input buffer, the situation improves dramatically.
Thank you both very much for the assistance.
Regards
Bill
>Bill,
>
>Did some tests this AM between 2 PC's, one a 486 running FoxPro DOS, the other Win98/VFP7.
>
>1. Did a Ymodem Xfer of command.com for a baseline - files compared.
>2. Created a test form with the MSCOMM control and a form property of INBUFFER. Set the InputMode to 1, RThreshold=1. In the OnComm event,
>
>DO case
> CASE THIS.commevent = 2
> THISFORM.inbuffer = THISFORM.inbuffer + THIS.INPUT
> IF LEN(THISFORM.inbuffer) = 92870
> outfile = "c:\temp\outtxt.bin"
> STRTOFILE(THISFORM.inbuffer,(outfile))
> THISFORM.inbuffer = ""
> ENDIF
>ENDCASE
>
>I then sent command.com as an ASCII file and the files compared.
>3. Repeated step 2 with InputMode=0 (text) and repeated. File sizes were equal, but differences were
major. I have no explanation for this :-)
>
>Bottom line, I think VFP has no problem storing the binary data into a string and dealing with it. I don't need no stinking byte arrays. I would try grabbing the data 1 byte at a time and test it.
>
>>Thanks, but I have no control over the format of the data being sent TO the serial port. I have to receive it as binary data which means I need to be able to access the input buffer as a byte array.
>>
>>Regards
>>Bill
>>
>>
>>
>>>Hope this helps:
>>>
>>>
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q154741&>>>
>>>Tracy
>>>
>>>>Hi
>>>>I am using the MSComm control within a VFP app to capture serial data. If you use the comm control to receive binary data, it is stored in the controls receive buffer as a byte array. How can I access this byte array from VFP in order to write the data out to a file?
>>>>
>>>>Thanks and regards
>>>>Bill