|
GPS ToolKit.NET
Open Method
Opens the communications port and begins reading GPS data.
Syntax
[Visual Basic]
object.Open(PortName)
[C#]
object.Open(PortName)
[C++]
object->Open(PortName)
[Visual Basic]
object.Open(PortName, BaudRate, Protocol)
[C#]
object.Open(PortName, BaudRate, Protocol)
[C++]
object->Open(PortName, BaudRate, Protocol)
[Visual Basic]
object.Open(FileStream)
[C#]
object.Open(FileStream)
[C++]
object->Open(FileStream)
[Visual Basic]
object.Open(FileStream, TimeScale)
[C#]
object.Open(FileStream, TimeScale)
[C++]
object->Open(FileStream, TimeScale)
Parameters
object
An object expression that evaluates to a GPSToolKit object.
PortName
A string containing the name of the communications port.
Protocol
A Protocol value specifying the protocol to be used when attempting communication with the GPS.
BaudRate
An integer representing the baud rate of the port.
FileStream
A System.IO.FileStream object representing the input file.
TimeScale
A value from 0 to 1000 indicating how fast the file data is consumed.
Return Value
None
Remarks
- To automatically make a connection with a connected GPS, use the AutoDetectGPS method.
- If a baud rate parameter is not supplied, GPS ToolKit will try to autodetect the correct baud rate and protocol for the connected GPS.
- To use a text file containing NMEA 0183 log data as input to GPS ToolKit, you may supply a FileStream object to this method.
- TimeScale is a multiplier that determines the speed at which a NMEA 0183 file 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.
Errors
- After opening a port or file using Open(), any subsequent call to Open() will cause
GPS ToolKit to throw PortAlreadyOpenException.
- An attempt to open a port that has already been opened by another application or
that does not exist will cause GPS ToolKit to throw PortOpenException
Example
[Visual Basic]
myGPSToolKit.Open("COM1")
[C#]
myGPSToolKit.Open("COM1");
[C++]
myGPSToolKit->Open("COM1");
See Also
BaudRate property, AutoDetectGPS method, Close method
|