By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Serial Port interfacing -Part 2

P: n/a
Hi All

I got some good responses from some of you guys regarding me serial port interfacing problem that I posted a little while back. However your help leaded me to this link belo

http://www.gotdotnet.com/Community/U...a7-73e09c4d589

Now my questions is - forgive me because I am still new at c# - that how do I use these clases? I think I need to build my own classes that inherit from these? But which classes must I build ie which ones must I inherit from? Do I have to implement every method that has the abstract keyword?, and what about the other methods defnined as protected, what do I do with those? And lastly, how do i set up an event so that when data arrives on the Com port an event is raised and provides me with the string that was sent down the line? Thats basically ALL I want to do, is receive a text string that is sent via the com port

Thanks for any hel
Kevin
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Kevin,

You will want to use the SerialPort class, which provides the
implementation of the SerialComm class.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Kevin" <an*******@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
Hi All,

I got some good responses from some of you guys regarding me serial port interfacing problem that I posted a little while back. However your help
leaded me to this link below
http://www.gotdotnet.com/Community/U...7-73e09c4d5890
Now my questions is - forgive me because I am still new at c# - that how do I use these clases? I think I need to build my own classes that inherit
from these? But which classes must I build ie which ones must I inherit
from? Do I have to implement every method that has the abstract keyword?,
and what about the other methods defnined as protected, what do I do with
those? And lastly, how do i set up an event so that when data arrives on the
Com port an event is raised and provides me with the string that was sent
down the line? Thats basically ALL I want to do, is receive a text string
that is sent via the com port.
Thanks for any help
Kevin

Nov 16 '05 #2

P: n/a

Open up his Terminal application that he provided in that solution. The
Terminal is the sample app that initializes the SerialPort object.

Experiment with adding your own project to the solution and then
initializing the same class. You need to re-implement (which might include
just writing empty methods) base class event handlers.

For the event, OnRecvI is your friend, although I could never get it to work
without going into multi-threading, so I just stuck with a timer picking up
the data every 100 ms or so.
--
Alex Moskalyuk
_____________________________
http://www.techinterviews.com

"Kevin" <an*******@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
Hi All,

I got some good responses from some of you guys regarding me serial port interfacing problem that I posted a little while back. However your help
leaded me to this link below
http://www.gotdotnet.com/Community/U...7-73e09c4d5890
Now my questions is - forgive me because I am still new at c# - that how do I use these clases? I think I need to build my own classes that inherit
from these? But which classes must I build ie which ones must I inherit
from? Do I have to implement every method that has the abstract keyword?,
and what about the other methods defnined as protected, what do I do with
those? And lastly, how do i set up an event so that when data arrives on the
Com port an event is raised and provides me with the string that was sent
down the line? Thats basically ALL I want to do, is receive a text string
that is sent via the com port.
Thanks for any help
Kevin

Nov 16 '05 #3

P: n/a
Hi Alex & all the other who helped me

I have done some serious research and I managed to get it to work! whoo hoo:) I have actually now got an event that fires when the OnRecv(byte[] b) is called, so now when something comes down the serial line my event is fired and I catch each charater and wait for a special character that determines the end of the string eg a #. Thanks so much for all your guys input, I really appreciate it, if I have any other questions, I'll be sure to be back here again:

Thank
Kevin
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.