Design the implementation of NMEA Get GPS Data from Record
1. EXPERIMENT NO. 3
AIM:
To study and design the implementation of NMEA Get GPS Data from Record
Apparatus Used:
Microsoft Windows XP, Professional Version 2002, Intel® Pentium® Dual CPU. E2180 @2.00
GHz, 2.00 GHz, 199 GB of RAM, Lab VIEW Robotics 2011 SP1
Theory:
LabVIEW (short for The Laboratory Virtual Instrumentation Engineering Workbench) is a platform and
development environment for a visual programming language from National Instruments in which you
create programs using a graphical natation (connecting functional nodes via wires through which data
flows), in this regard, it differs from traditional programming languages like C, C++, or Java in which you
program with text. However LabVIEW is much more than a programming language. It is an interactive
program development and execution system designed for people, like scientists and engineers, who need
to program as part of their jobs. The LabVIEW development environment works on computers running
Windows, Mac OS X, or Linux. LabVIEW can create programs that run on those platforms, as well as
Microsoft Pocket PC Microsoft windows CE, Palm OS, and a variety of embedded platforms, including
Field Programmable Gate Arrays (FPGAs), Digital Signal Processors (DSP), and Microprocessors.
Procedure:
Execution is determined by the structure of a graphical block diagram on which the programmer connects
different function nodes by drawing wires. These wires propagate variables and any node can execute as
soon as all its input data become available. LabVIEW ties the creation of user interface (front panels) into
the development cycle. LabVIEW programs/subroutines are called virtual instruments (VIs). Each VI has
three components; a block diagram, a front panel, and a connector panel. The last is used to represent the
VI in the block diagram of other, calling VI. Controls and indicators on the front panel allow an operator
to input data into or extract data from a running virtual instrument. However, the front panel can also serve
as a programmatic interface. Thus a VI can either be run as a program, with the front panel serving as a
user interface, or when dropped as a node onto the block diagram, the font panel defines the inputs and
outputs for the given node through the connector pane. This implies each VI can be easily tested before
being embedded as a subroutine into a larger program. The graphical approach also allows non-
programmers to build programs simply by dragging and dropping virtual representation of lab equipment
with which they are already familiar.
2. Execution of VI’s and Sub –VI’s:
Main VI:
This VI reads NMEA data from a file and plots the latest location and heading data. To process NMEA
sentences individually rather than as a group of sentences, use the Vis on the NMEA Advanced palette.
Sub VI:
Creating Steering:
Front Panel of NMEA API.lvlib: Get GPS Data.vi
Previous partial sentence contains characters to prepend to sensor data. Sensor data contains the data to
parse for GPS data. This VI appends sensor data to previous partial sentence and then parses the data.
3. Build Path Function:
Creates a new path by appending a name (or relative path) to an existing path.
Base path specifies the path to which this function appends name. The default is an empty path. Appended
path is the resulting path.
Open/Create/Replace File Function:
Opens an exixting file, creates a new file, or replaces an existing file, programmability or interactively
using a file dialog box. This function does not work for files inside the LLB.
4. File Path (use dialog) is the absolute path to the file. If you do not wire file path (use dialog), the function
displays a dialog box from which you can select a file. If you specify an empty or relative path, this
function returns an error. Return if the file cannot be opened.
Select Function:
Returns the value wired to the t input or f input, depending on the value of s. If s is TRUE, this function
returns the value wired to t. If s is FALSE, this function returns the value wired to f.
‘t’ is the value that this function returns if s passes a TRUE value. T and f must be of the same type, but
they can have different numeric representations. s determines whether the function returns the value of t
or f in s? t:f. If you wire an error cluster to s and an error occurs, the error cluster passes a TRUE value to
the function. Otherwise, the error cluster passes a FALSE value to the function.
Result:
NMEA Get GPS Data VI reads NMEA data from a file and plots the largest location and heading data.
The map indicator is an XY graph with an image snippet used as a background image. You can adopt this
VI to acquire data from a real GPS receiver with drivers instead of reading data from a file.
NMEA get GPS data VI procedure is as first it opens the text file that contains NMEA sentences. Reading
400 characters from the text file, which is similar to acquiring streaming data from a GPS receiver. Read
an amount of characters from a file or instrument that is enough to include several NMEA sentences.
Parses complete sentences in the sensor data into a cluster of common GPS data point. When the string of
data sensor contains more than one value for a data point, the Get GPS Data VI returns the most recent
value. After this VI runs, any remaining partial sentence not yet parsed passes to a shift register to be used
on the next iteration of the loop. Unbundles desired data points and checks that value are valid, or not
‘NaN’. Refer to the Get GPS data VI help topic for more information about invalid values from the shift
registers then it closes the text file.
Precautions:
To avoid hanging the user interface with front panel locking, configure all events you want a VI to
handle in a single Event structure or always make sure there is only one Event structure in a loop.
Additionally, make sure there is always an Event structure available to handle events as they occur.