473,473 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Jul 21 '05 #1
3 1198
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.
Jul 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.

Jul 21 '05 #3
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.

Jul 21 '05 #4

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...
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...
2
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...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.