|
-
Nov 22nd, 2011, 08:17 PM
#1
Thread Starter
New Member
Why MSComm.InBufferCount comparison affectS MSComm.Input content?
Programming Language = Visual Basic 6 (SP6a)
Related To : Having MSComm to accept signal returned from Serial COM Port
My intention is to compare if the MSComm1.InBufferCount is larger than a specified number, then assign the ENTIRE ORIGINAL MSComm1.Input to InputBytes.
My Sample Codes:-
/***
Dim InputBytes() As Byte
Dim iCheckNumber As Interger
Do While MSComm1.PortOpen
If MSComm1.InBufferCount >= iCheckNumber Then 'expect structure length
InputBytes = MSComm1.Input ' In coming data from serial port
Exit Do ' Exit loop
Else
DoEvents
End If
Loop
***/
My Finding:-
If iCheckNumber = 50 ; InputBytes = `00000000066090083628147000000416902588
If iCheckNumber = 75 ; InputBytes = `00000000066090080911987000000416903588734702681597949121544
My Question:-
I would like to know whether my findings is true? Is there any better way to achieve the result I wish.
Thanks
Regards,
Mr.SU
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|