polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively
polling mscomm1 input effectively polling mscomm1 input effectively
polling mscomm1 input effectively
Go Back  Xtreme Visual Basic Talk > > > polling mscomm1 input effectively


Reply
 
Thread Tools Display Modes
  #1  
Old 12-16-2003, 09:25 PM
hont hont is offline
Freshman
 
Join Date: Aug 2003
Posts: 39
Default polling mscomm1 input effectively


I was wondering what is the most effective way of polling data from MSComm1.input


What I'm doing is trying to receieve some data from MSComm1. I am having no problem receiving the data.

MSComm1.rThreshold is set to 1


The scanner I am using scans all kinds of different barcodes.

I am looking for a certain character, Chr(4)

Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent

Case comEvReceive

mybuff = mybuff & MSComm1.Input


End Select


If Right(mybuff, 1) = Chr(4) Then Call Display_Tracking

End Sub



However, how do I detect when MSComm is DONE receiving... if it is done, I want to CLEAR mybuff

Basically the problem is that the data is stacking up in mybuff.

For example, I scan two incorrect barcodes, then the one correct one. My data looks like

badbarcodedata1badbarcodedata2correctdata

Any suggestions? Thank you.
Reply With Quote
  #2  
Old 12-17-2003, 08:34 PM
hont hont is offline
Freshman
 
Join Date: Aug 2003
Posts: 39
Default

anyone?
Reply With Quote
  #3  
Old 12-18-2003, 05:58 AM
BillSoo's Avatar
BillSoopolling mscomm1 input effectively BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default

If the code is always the same length, you could simply discard the first few characters if it's too long.

Alternatively, you could implement some kind of timeout that automatically flushes your buffer if it receives no new characters after 100ms.
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stripping escape characters from input buffer mscomm1 Kevalson Communications 5 07-02-2003 09:48 AM
input past eof anthonylmin General 2 06-18-2003 09:13 PM
Help with array Gaza General 11 06-02-2003 08:59 AM
Makin a nice little program! Decontain Communications 3 04-11-2003 02:54 AM
opening arrays from files kwijibo General 14 07-22-2002 05:47 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively polling mscomm1 input effectively
polling mscomm1 input effectively
polling mscomm1 input effectively
 
polling mscomm1 input effectively
polling mscomm1 input effectively
 
-->