Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GPS And VFP
Message
 
À
14/02/2006 13:00:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01096210
Message ID:
01096244
Vues:
16
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform