Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSCOMM maximum serial port OutBufferSize

Status
Not open for further replies.

GVF

Programmer
Feb 25, 2005
160
US
Hi all,

I am communicating with a piece of equipment through the serial port using MSCOMM32.ocx

There is an occasional problem (possibly machine dependant) that results in portions of the upload getting scrambled.

Using PortMon I see that my VBA code is sending the data correctly and I suspect a possible output buffer over-flow as the device might not be able to pull the data out as fast as the computer is sending it.

When I send the data I am using a Do Loop to pause for .2 seconds between sending strings to the device. The code works and is absolutely consistent at .2 seconds (and I can make an upward adjustment there). I tried to use Application.Wait but I was not able to 1: get consistent results and 2: Fool it into waiting for periods of less than one second.

My questions are:
What is the max size that I can set the output buffer to? (The default appears to be 512 bytes. I would rather increase the outbuffersize than slow down the code any further.) Is the max output buffer size machine dependant?
Is there a way to utilize Application.Wait for less than one second?
Is there another way to pause the code to allow the device to read from the outbuffer at its own pace (an API cal or something)? The Do Loop keeps the computer busy and I would rather it be idle during the wait period.

Tommorrow I have to go out and fix the problem so any help from you weekend responders would be appreciated (or I will spend my Sunday in a trial and error session.)

Greg

 
Max Input or Output buffer size is 32256 bytes.\
Trial and error is tedious.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top