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

Writing to Serial Port in Windows Mobile 5.0

SerialNET.Port
--------------------------------------------------------------------------------

Can anybody tell me how to use SerialNET.Port in Visual Studio 2005.

I am currently developing a project in vb.net for Windows Mobile 5.0 Compact Framework 2.0. When I use the following syntax:-

Dim objport as New SerialNET.Port I get an error saying that SerialNET.Port is not defined.

I am using imports for System.Net, System.IO and System.IO.Ports.

Am I missing something ??
Aug 2 '07 #1
5 13512
Plater
7,872 Expert 4TB
Windows Mobile or Windows CE?

And the object is called SerialPort (System.IO.Ports.SerialPort) not SerialNet.Port (at least in my version of CF2.0)
Aug 3 '07 #2
Hello,

Ihave changed my old Palm M105 to phone with windows mobile 5./ HTC TyNT/

Phone with mobile 5 /HTC TyTN/ is assembled only with USB. How can y caputure any serial comunication /RS 232/ in this device?


can you help me with this problem?
Thanks

Miroslav Ulrich
Slovakia
Europe

on my old palm M105 y have used program "serialgo" on capturing serial communication. works o.k.
Nov 22 '07 #3
hi! i'm trying to communicate a ipaq hp hx2700 with windows mobile 5.0 with my pc via serial port.

i'm having some troubles to send data from the pc to the pda....it says the mistake is because im not using control.invoke method.

i dont know how to use it and i dont understand the visual studio 2005 help.

here's my code:
Expand|Select|Wrap|Line Numbers
  1.  Imports System
  2. Imports System.IO.Ports
  3. Imports System.Windows.Forms.Control
  4.  
  5. Public Class Form1
  6.  
  7.     Dim WithEvents control As Control = New _
  8.      System.Windows.Forms.Control(CheckForIllegalCrossThreadCalls.False)
  9.  
  10.     Dim WithEvents port As SerialPort = New _
  11.      System.IO.Ports.SerialPort("COM1", 9600, Parity.None, 8, StopBits.One)
  12.  
  13.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  14.  
  15.         If port.IsOpen = False Then
  16.             port.Open()
  17.         End If
  18.  
  19.     End Sub
  20.  
  21.     Private Sub port_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles port.DataReceived
  22.         TextBox1.Text = (port.ReadTo("!%"))
  23.         If port.ReadExisting.Length = 0 Then
  24.             ListBox1.Items.Add(TextBox1.Text)
  25.             TextBox1.Text = ""
  26.         End If
  27.     End Sub
  28.  
  29.     Private Sub Form1_Close(ByVal sender As Object, ByVal e As _
  30.                            System.EventArgs) Handles Me.Load
  31.         If port.IsOpen = True Then port.Close()
  32.     End Sub
  33.  
  34.     Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
  35.         Application.Exit()
  36.     End Sub
  37. End Class

Thank you very very much!!!!

Lina
Feb 11 '08 #4
RedSon
5,000 Expert 4TB
Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
Feb 11 '08 #5
Plater
7,872 Expert 4TB
Using Invoke usually means you are trying to avoid erros caused by interacting with a GUI component on a thread that it was not created on.
If an event handler for an object that runs with it's own thread is going to modify a GUI component you will have implement some thread-safe accessing methods.
I recomend you familarize yourself with the msdn library/help, it can be very usefull once you get the hang of using it.
Feb 12 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
4
by: Petr Jakes | last post by:
I am trying to save data it is comming from the serial port continually for some period. (expect reading from serial port is 100% not a problem) Following is an example of the code I am trying to...
0
by: semagu | last post by:
Hi! I am trying to send/receive information from a device using the serial port of my Smartphone (Windows Mobile 5), but I only can read data. I am using C# I can't send anything, everything I...
0
by: User | last post by:
I need to create a serial port on my "Windows Mobile 5.0 Poket PC" to send data to application receiving data from serial port. For example, I create a serial port COM10, other application connect...
2
by: Nasif | last post by:
Currently I am writing a program which sends and receives messages through serial port to a device. I am using C# and Microsoft Visual studio 2005 for windows program. But my problem is when i try...
5
by: kkadrese | last post by:
hello group, how to get ttyS0 serial port for exclusive access? I have a python script that uses this device with AT commands. I need that two instances can call simultaneosuly this python...
0
by: Charles Crawford | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: =?Utf-8?B?Q2hhcmxpZQ==?= | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.