Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GPS And VFP
Message
From
14/02/2006 13:00:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01096210
Message ID:
01096239
Views:
18
>I need to get input from anyone who has interfaced a GPS system for tracking vehicles with
>a VFP application.

This worked for me with an old Garmin handheld device plus a ship mounted GPS device. With handheld one I could draw travelling path realtime in my car (within device's error range).
* Called from a timer - interested in GGA and GSA data only
* load mscomm
oComm = CREATEOBJ('MSCOMMLib.MSComm')
* Open and Initialize COM port #1 for use
With oComm
	.CommPort = 1
	.Settings = "4800,N,8,1"
	.InputLen = 1
	.PortOpen = .T.

	lcDATA=''
	lnStart = datetime()
	llDataReady = .F.
	Do while datetime()-lnStart < 5
		.InputLen = 1
		lcDATA = lcDATA+.input
		lnGGA = at('$GPGGA',lcData)
		lnGSA = at('$GPGSA',lcData)
		If lnGGA > 0 and lnGSA > lnGGA && Read enough
			llDataReady = .T.
			Exit
		Endif
	Enddo
	* Close the port
	.PortOpen = .F.
Endwith
Release oComm
if llDataReady
	thisform.WriteGPSData(lcData, datetime()) && writing to a table
else
	wait window timeout 2 'GPS timedout!'
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform