LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Mscomm1 buffer problem

I have the following code that reads a Data Acquisition system. It is
suppose to put the data from CALL 1 into textbox1 and CALL 2 into
textbox2. However they are comming back reversed. I checked my
userform and I have the textboxs labeled correctly (not reversed)

When I comment out either channel it put the data in the correct
textbox.
I eventually need 5 channels. My system will not read all the
channels simultaneously so I have to loop thru each channel to get its
value.
I have tried varying a delay to see if the buffer is getting updated
too fast but I have not had luck with that approach.

I was looking for a feedback to know the buffer is complete before
outputing to the form. I have my bufferlength set to 0 so it brings it
in all at once instead of each bite.

What can I do here to correct this problem?
Thanks in advance.

BTW: Netcomm1.ocx is the free version of MSCOMM1.ocx. The only
difference is the "input" needs the "data" added.


Private Sub CommandButton21_Click() ' Stream Data into Channels

CommandButton21.Enabled = False
CommandButton23.Enabled = True

C1 = True

Do While C1 = True

Buffer1$ = ""
NETComm1.Output = "CALL 1" & Chr(13) ' retrieve reading
from Serial Device
Buffer1$ = Buffer1$ & NETComm1.InputData
TextBox1 = Application.Clean(Buffer1$)
TimedDelay (0.5)

Buffer2$ = ""
NETComm1.Output = "CALL 2" & Chr(13) ' retrieve reading
from Serial Device
Buffer2$ = Buffer2$ & NETComm1.InputData
TextBox2 = Application.Clean(Buffer2$)
TimedDelay (0.5)
Loop
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can buffer the row height of my data. RSB Excel Discussion (Misc queries) 1 April 15th 08 11:35 PM
Read Keyboard Buffer ? Gary''s Student Excel Programming 2 September 7th 06 03:42 AM
Reading txt file into the buffer WannaBeExceller Excel Programming 2 February 8th 06 11:21 PM
buffer overflow Jeff Sward Excel Programming 0 January 7th 04 07:46 PM
Emptying the copy buffer justin Excel Programming 1 October 27th 03 03:03 PM


All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"