473,569 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.DoE vents()

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

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

End With

Application.DoE vents()
Debug.WriteLine ("Attempting read.")
Application.DoE vents()

Do

Debug.WriteLine (GPSCom.ReadLin e)
Application.DoE vents()

Loop

End Sub

Aug 8 '06 #1
2 2887

..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.DoE vents()

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

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

End With

Application.DoE vents()
Debug.WriteLine ("Attempting read.")
Application.DoE vents()

Do

Debug.WriteLine (GPSCom.ReadLin e)
Application.DoE vents()

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
2174
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, m_aBuffer.Length, SocketFlags.None) m_sMes += ASCII.GetString(m_aBuffer, 0, bytes) Console.WriteLine(m_sMes) If (bytes < m_aBuffer.Length) Then
6
17151
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, process and output to the screen in my application when a message arrived. But the problem is how do I read the SMS message immediately when it arrived...
2
2527
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 Express Edition. Sample Code: Function ReceiveSerialData() As String ' Receive strings from a serial port. Dim returnStr As String = ""
2
6170
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 just go no where. I can see the recived data in my serial receive function but when I either raise an event with it or try to display it in a text...
0
1144
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 code; void CMscomDlg::OnOnCommMscomm1() { // TODO: Add your control notification handler code here CString msg; UpdateData();
1
1610
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 display the temperature result on the computer screen. First, the data will transmit from CPLD, then it will send by MAX232 to RS232 and then display...
6
6637
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 '%' to serial port and make sure it reached the serial port. 2. Once confirmed, send another character.
7
3757
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 start a timer when the first byte arrives and wait for a pre determined time and then check the serial buffer for the data. I can't seem to get the...
1
4278
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 axes output) from the output. I use hyperterminal with the below settings and it works fine: baudrate=115200 databits=8
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.