473,386 Members | 1,720 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.

Receive serial data

I am trying to receive GPS data into a pocket PC 5.0. I am using the
device emulator. The main PC has a bluetooth dongle connected and is
bonded with the bluetooth GPS transmitter to COM8. In the device
emulator, I am mapping Serial Port 1 to COM8. The below code *should*
work as far as I can see but it does not. It hangs on the ReadLine
line. Any ideas anyone?
If I use hyperterminal on the main computer to read COM8 I can see the
GPS data so the GPS is working OK. Help!?!!
Private Sub ReadGPS

Debug.WriteLine("Starting")
Application.DoEvents()

Debug.WriteLine("Creating COM Port")
Dim GPSCom As New IO.Ports.SerialPort
With GPSCom

.PortName = "COM1"
.BaudRate = "2400"
.DataBits = 8
.Parity = IO.Ports.Parity.None
.StopBits = IO.Ports.StopBits.One
.NewLine = "$"
.Open()

End With

Application.DoEvents()
Debug.WriteLine("Attempting read.")
Application.DoEvents()

Do

Debug.WriteLine(GPSCom.ReadLine)
Application.DoEvents()

Loop

End Sub

Aug 8 '06 #1
2 2865

..BaudRate = Should be integer, I guess (not a string)

Try also with ReadChar to check receive. In case add line crlf.

Tommaso

Hugh Janus ha scritto:
I am trying to receive GPS data into a pocket PC 5.0. I am using the
device emulator. The main PC has a bluetooth dongle connected and is
bonded with the bluetooth GPS transmitter to COM8. In the device
emulator, I am mapping Serial Port 1 to COM8. The below code *should*
work as far as I can see but it does not. It hangs on the ReadLine
line. Any ideas anyone?
If I use hyperterminal on the main computer to read COM8 I can see the
GPS data so the GPS is working OK. Help!?!!
Private Sub ReadGPS

Debug.WriteLine("Starting")
Application.DoEvents()

Debug.WriteLine("Creating COM Port")
Dim GPSCom As New IO.Ports.SerialPort
With GPSCom

.PortName = "COM1"
.BaudRate = "2400"
.DataBits = 8
.Parity = IO.Ports.Parity.None
.StopBits = IO.Ports.StopBits.One
.NewLine = "$"
.Open()

End With

Application.DoEvents()
Debug.WriteLine("Attempting read.")
Application.DoEvents()

Do

Debug.WriteLine(GPSCom.ReadLine)
Application.DoEvents()

Loop

End Sub
Aug 8 '06 #2
Hi,
>>
I am mapping Serial Port 1 to COM8. The below code *should*
work as far as I can see but it does not. It hangs on the ReadLine
line. Any ideas anyone?
<<

You say that you are mapping Serial Port 1 to COM8. Are you sure this is
what you want? COM8 should be mapped to Serial Port 0 (COM1 on your PPC
emulator), Serial Port 1 is COM2, not COM1.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Aug 8 '06 #3

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

Similar topics

3
by: TacoGod | last post by:
I am trying to retrieve a file list from a ftp. I got this code from the microsoft website: Do While (True) m_aBuffer.Clear(m_aBuffer, 0, m_aBuffer.Length) bytes = cSocket.Receive(m_aBuffer,...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
2
by: ken | last post by:
Hello everyone, I'm new to visual VB and I am trying to setup communications using the Function ReceiveSerialData() As String example found in the help section of Microsoft Visual Basic 2005...
2
by: Lou | last post by:
I have a class that creates an instance of the seril Port. Every thing works fine except whenever I receive data I cannot display the recieved data. I get no errors but the recived data seems to...
0
by: ktg024 | last post by:
Hi all, I am beginner to VC++, I am trying to transmint and receive data through serial port using MSCOM. I am able to transmit data but I am unable to receive the data here is my receive...
1
by: Beginner KS | last post by:
Hi, I want to design a form in the VB2005(visual studio 2005) to receive data(temperature measurement result) from microcontroller(which is CPLD coolrunner II) after received the data then it will be...
6
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send...
7
by: seegoon | last post by:
Hi to all. I have a application that receives data via the serial port. I don't know the number of bytes that are going to be coming in. It could be 10 up to 150. (9600 baud) I have decided to...
1
by: rfarley | last post by:
Hi, I am using the pyserial module and am trying to read the serial port from an accelerometer (LIS302DL). It has an option in which you write "*debug\r\n" and then you read the data (three...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
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...

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.