Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GPS And VFP
Message
 
To
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:
01096244
Views:
18
Thanks!


>>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
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform