About GPS ToolKit
Introduction
Purchasing GPS ToolKit
Redistributing GPS ToolKit
License Agreement
Support
Getting Started
How to Use GPS ToolKit
Adding GPS ToolKit to a Visual Basic Project
Adding GPS ToolKit to a Visual C++ Project
Adding GPS ToolKit to an Excel Worksheet
Setting up the GPS
How to Use Events
Handling Events in Visual Basic
Handling Events in Visual C++
Handling Events in Microsoft Excel
GPS ToolKit Sample Projects
Handling GPS ToolKit Errors
Reference
Properties
Altitude
AltitudeUnits
ArrivedAtDest
AutomaticOperation
BaudRate
CrossTrackError
DegLabel
DestClosingVelocity
DestWptID
DestWptLatitude
DestWptLongitude
DistUnits
DGPSRefStationID
FixDateTime
FixGood
FixQuality
FixSatellitePRNs
GeoidHeightAboveWGS84Ellipsoid
HDOP
Latitude
LatLonFormat
Longitude
MagVariation
MinLabel
ModeIndicator
NumSatellitesInFix
NumSatellitesInView
OperationMode
OrigToDestMagBearing
OrigToDestTrueBearing
OriginWptID
PDOP
PortHandle
PortName
RangeToDest
RouteContainsAllWpts
RouteName
SatelliteInViewPRNs
SecLabel
Speed
SpeedUnits
TimeSinceLastDGPSUpdate
TrueBearingToDest
TrueCourse
VDOP
WptsInRoute
Methods
Close
GetSatelliteInfo
GetWptLocation
Open
OpenFile
Events
FixUpdate
FileComplete
NavUpdate
RawDataReceived
SatelliteUpdate

OpenFile Method

Opens and reads a text file of NMEA 0183 data.

Syntax

Visual Basic

object.OpenFileFilename[, TimeScale]

Visual C++

object.OpenFile(Filename, TimeScale)

Part Description
object An object expression that evaluates to a GPS ToolKit object.
Filename A string containing the name of the input file.
TimeScale A value from 0 to 1000 indicating how fast the file data is consumed. This parameter is optional in VB and defaults to 0.

Example

Visual Basic

myGPSToolKit.OpenFile "C:\GPSData.txt", 1

Visual C++

_variant_t vtTimeScale((short)1);
_variant_t vtFilename("C:\\GPSData.txt");
m_myGPSToolKit.OpenFile(vtFilename, vtTimeScale);

Remarks

  • TimeScale is a "multiplier" that determines the speed at which the file GPS data is read. A value of 1 causes GPS ToolKit to "play" the file in real time, while a value of 10 tells GPS ToolKit to "play" the file 10 times faster than real time. Likewise, a value of 0.1 tells GPS ToolKit to read the file 10 times more slowly. A value of 0 indicates that GPS ToolKit should read the file as quickly as possible.
  • The file read may be cancelled during execution by calling the Close method.
  • Upon completion or cancellation of the file read, GPS ToolKit will fire the FileComplete event.

Returns

Nothing

Errors

  • After opening a port using OpenFile(), any subsequent call to Open() or OpenFile() will cause GPS ToolKit to throw a "Port or file is already open" exception.
  • If unable to find or open the specified file, GPS ToolKit will throw a "Unable to open file" exception.

See Also

BaudRate property, Open method, Close method