473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

SerialPort_ReceivedEvent splits data in parts

Hi,

I'm having some troubles with my Serial-Port application:

It always splits the ReceivedData in different parts.
for exemple: I should receive "SIM PIN REQUIRED", but I receive iit in 3
different events: "SIM PI", "N REQUIR" and "ED". does anybody knows why this
happens? And how I can do something about this? Is it some setting fo the
comport? A buffer need to make larger?

thanks a lot in advance,

Pieter
Nov 21 '05 #1
2 942
Hi,

This is normal (all communications work this way, not just serial). You can
never assume that a full message will be available when you want it -- you
must wait for it.

You have two options. Either add a delay BEFORE you attempt to input the
data, of sufficiently long duration to assure that the device will have
completed sending it to you, or... (BEST), simply append new data as it
arrives to a buffer. As soon as it all has arrived, you process it. You
may determine this by length or by content.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004.
Nov 21 '05 #2
Thanks!
Well, I did it the second way, it seemd the best, fastest and most flexible
to me too.

Pieter

"Dick Grier" <di**************@msn.com> wrote in message
news:uR*************@TK2MSFTNGP15.phx.gbl...
Hi,

This is normal (all communications work this way, not just serial). You can never assume that a full message will be available when you want it -- you
must wait for it.

You have two options. Either add a delay BEFORE you attempt to input the
data, of sufficiently long duration to assure that the device will have
completed sending it to you, or... (BEST), simply append new data as it
arrives to a buffer. As soon as it all has arrived, you process it. You
may determine this by length or by content.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Joe | last post by:
I need to connect to 10 web sites to grab content from them. I would like to connect to each site simultaneously so that I can obtain the data as fast as possible. I am familar doing this with...
0
by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have...
3
by: DraguVaso | last post by:
Hi, I'm having some troubles with my Serial-Port application: It always splits the ReceivedData in different parts. for exemple: I should receive "SIM PIN REQUIRED", but I receive iit in 3...
4
by: teddysnips | last post by:
This is a rather abstract question about data design, but I ask it here because a) the database is SQL Server, and b) you're such a learned bunch! Let's assume the classic relation of Customers...
3
by: Seamus Hand | last post by:
I am trying to write a component maintenance application and have tables as follows Part Part # Part Description Active (y/N) as these parts are obsoleted, ie Active changes to N, then I...
6
by: Ben Wilson | last post by:
I am working on a script that splits a URL into a page and a url. The examples below are the conditions I expect a user to pass to the script. In all cases, "http://www.example.org/test/" is the...
3
by: weboweb | last post by:
Hi, I'm new in web parts, I would like to understand a couple of things: Let's say I have a custom control that displays information. That info is fed to the control through an XML string, so...
18
by: =?Utf-8?B?Q2hhcmxlc0E=?= | last post by:
I've just finished getting my web 2.0 MCTS, and the exam seemed to have a disproportionate interest in Web Parts. Personally, I don't really see the point of them Should I think again? can...
92
by: bonneylake | last post by:
Hey Everyone, Well i was hoping someone could explain the best way i could go about this. i have a few ideas on how i could go about this but i am just not sure if it would work. Right now i...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.