473,386 Members | 1,793 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,386 software developers and data experts.

Serialport Class: SerialDataReceivedEventHandler

Hello all!

I was wondering if any of you could shed some light on this problem I cant
seem to figure out...

I try to add an event handler to my SerialPort variable by doing:

mySerialPort.DataReceived += new
SerialDataReceivedEventHandler(newDataReceived);

where "newDataReceived" is the function delegated to handle the event of new
data being received on the serial port. Upon debugging, however, the program
never calls the newDataReceived function, even though new data is clearly
being received (after testing). Any ideas? Thank you!!!
Nov 17 '05 #1
3 10504
wg
Check out this web site. They have a reference to a web site of an example.

www.htservices.com

wg
"Nathan Ie" <Na******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
Hello all!

I was wondering if any of you could shed some light on this problem I cant
seem to figure out...

I try to add an event handler to my SerialPort variable by doing:

mySerialPort.DataReceived += new
SerialDataReceivedEventHandler(newDataReceived);

where "newDataReceived" is the function delegated to handle the event of
new
data being received on the serial port. Upon debugging, however, the
program
never calls the newDataReceived function, even though new data is clearly
being received (after testing). Any ideas? Thank you!!!

Nov 17 '05 #2
Thanks wg. I checked out that site too, but the code is in VB. Trying to find
a way to do so in C#. Thank you though. I appreciate it!

"wg" wrote:
Check out this web site. They have a reference to a web site of an example.

www.htservices.com

wg
"Nathan Ie" <Na******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
Hello all!

I was wondering if any of you could shed some light on this problem I cant
seem to figure out...

I try to add an event handler to my SerialPort variable by doing:

mySerialPort.DataReceived += new
SerialDataReceivedEventHandler(newDataReceived);

where "newDataReceived" is the function delegated to handle the event of
new
data being received on the serial port. Upon debugging, however, the
program
never calls the newDataReceived function, even though new data is clearly
being received (after testing). Any ideas? Thank you!!!


Nov 17 '05 #3
Hi, try

myPort.DtrEnable = true;
myPort.RtsEnable = true;

that worked for me
--
Regards, Andreas
"Nathan Ie" wrote:
Hello all!

I was wondering if any of you could shed some light on this problem I cant
seem to figure out...

I try to add an event handler to my SerialPort variable by doing:

mySerialPort.DataReceived += new
SerialDataReceivedEventHandler(newDataReceived);

where "newDataReceived" is the function delegated to handle the event of new
data being received on the serial port. Upon debugging, however, the program
never calls the newDataReceived function, even though new data is clearly
being received (after testing). Any ideas? Thank you!!!

Nov 17 '05 #4

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

Similar topics

0
by: Nathan Ie | last post by:
Hi there! Not sure how many of you out there are familiar with the Serialport Class, but I'm trying to add an event handler for every time I receive new incoming data from the serial port by...
0
by: LordHog | last post by:
Hello all, I would like to use the new SerialPort class in Visual C++ 2005 Express edition, but I am having problems adding my event handler to the DataReceived event. In the header file I have...
4
by: Ben Kim | last post by:
Hello all, Does anyone have an example on how to implement the new SerialPort Class in VB.NET? I have been able to create the class, send (.WriteLine) to the port and Read from the port but...
13
by: Jean Paul Mertens | last post by:
Hello, Someone can tell me why I dont get serial port events in a Service, I created a separate Thread to open the port but no events are coming up (the same happens when I use the timer...
0
by: nmsreddi | last post by:
Hi friends I am working on serialport in c# ,i am using C#2005 i have successfully done the serial communication with GSM modem and able to send and receive data , the main problem ,the serial...
7
by: Simon | last post by:
Hi all, I'm writing a PocketPC / CE application which communicates with a Bluetooth GPS reciever that is paired to a serial port but I'm experiencing odd behaviour from the CF 2.0 SerialPort...
1
by: Lars Siden | last post by:
Hi, I've really struggled with this. Using Hyperterminal everything works fine. But if I write my own program I can't get "OnDataReceived" to be fired. MS samples from the SDK gives me the...
0
by: cronusf | last post by:
I set up two virtual COM ports 3 and 4 using com0com. I tried to test it with the following program. However, the DataReceived event handlers never get called. Can anyone with SerialPort class...
8
by: Kevin.M.Jonas | last post by:
I have the following method that handles the data received event: private void _port_DataReceived(object sender, SerialDataReceivedEventArgs e) { string data = _port.ReadExisting();...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.