Solved

Serial Port Communication

Posted on 2004-07-31
18
51,309 Views
Last Modified: 2012-06-22
G'day Everyone,

I want to write a Smart Device Application in C# which extracts the data from an external device connected to the iPaq through the serial port. How can I go about doing this? Any examples? Does Visual Studio .NET 2003 have any support for this? Thanks.
0
Comment
Question by:MastaBlasta
  • 6
  • 6
  • 3
  • +3
18 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 200 total points
ID: 11685038
http://opennetcf.org/CategoryView.aspx?category=Home contains IO.Serial which will allow you to handle the serial port ... also it includes copious examples and alot of other usefull libraries. It is the extension to the compact framework everyone should have.
0
 

Author Comment

by:MastaBlasta
ID: 11685256
Thanks. I have downloaded the Smart Device Framework zip file. Where do I extract/install the framework libraries so that whenever I start an application in VS, I can get System.IO.Serial?
0
 

Author Comment

by:MastaBlasta
ID: 11685350
Got it. Thanks. Another question: I already have a pre-existing Smart Device application and I would be making changes to that in order to get the serial port communications working. Now to access openetcf libs I have to choose an OpenNetCF application. How can I alter my existing Smart Device code and also use the OpenNetCF libs like(using OpenNetCF.IO.Serial) at the same time? Sorry it may seem like a dumb question. :)
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11685525
add a reference to the opennetcf dll that you want
0
 

Author Comment

by:MastaBlasta
ID: 11693146
Thank you once again gregory. One more question. If I have a cable with a serial connection on one end(which goes into the external device) and a sync cable connection on the other(which goes into the iPAQ), can I capture data by just using IO.Serial, i.e by using OpenNETCF lib? The cable that I have described is this: http://www.expansys.com/product.asp?code=I3600USBSERY
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11695126
providing that activesync isnt already running on the port otherwise you will get port open errors on both sides.
0
 

Author Comment

by:MastaBlasta
ID: 11696450
Sorry for hecking you gregory :-), but I just need to clear one little confusion of mine. I will attach an external device with my iPAQ, through a serial connection and the other end of that cable will plug into the iPAQ(sync connection). So now can I extract the data coming in from the device using *just* the IO.Serial lib or do I need to extract it from the sync connection, using some sync library?

Also, the ActiveSync needs to be turned off, is that correct?
0
 

Author Comment

by:MastaBlasta
ID: 11696457
I am increasing points too as I have really bombarded you with questions. :-)
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11697111
yes if activesync is running on the same port ... otherwise you can use just the serial.io library and treat it as a serial port...

the reasonit needs to be off is that serial ports generally dont like more than one app trying to use them.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:Lumica
ID: 11702152
Just a side note: it seems there will be support for serial communication in visual studio 2005.

Some more info at about the announcement:
http://blogs.msdn.com/junfeng/archive/2004/08/01/203813.aspx

and a few comments about the class itself:
http://weblogs.asp.net/pwilson/archive/2003/10/28/34218.aspx
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11705212
thats 2.0 of the framework ... they have not yet said if it will be supported in the compact framework.
0
 

Author Comment

by:MastaBlasta
ID: 11722858
Thanks for your help gregory.
0
 

Expert Comment

by:arindamgupta
ID: 13390038
Hi,

I need to query COMM port or serial port in .Net Compact Framework.
Can anyone please help me?

I need to connect a device via COMM / Serial Port to a PDA, and query the device from an application written on VB.Net...   on the PDA ??

Please help ....

Arindam Gupta
*****
0
 

Expert Comment

by:poojasureshkumar
ID: 14733525
Hi,
I need to connect device via TCP /IP and read the data on it's serial port. Is it possible in C#,win form. Pleas help me .

Thanks in Advance,
Suresh
*****
0
 

Expert Comment

by:poojasureshkumar
ID: 14733534
Hi,
I need to connect device via TCP /IP and read the data on it's serial port. Is it possible in C#,win form. Pleas help me .

Thanks in Advance,
Suresh
****
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 14734123
yes it is .. use the same library as listed here and the Tcp Classes in the framework.

Also I have editted your posts to remove phone numbers.
0
 

Expert Comment

by:poojasureshkumar
ID: 14734825
Thanks GregoryYoung..Let me try this code..
Once again Thanks for the help....
0
 
LVL 4

Expert Comment

by:xPert_Umer
ID: 14739981
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now