gpsEnableNMEA (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2, CX1, SX1, MX2 turbo/encore/warp, NX-200, NX-400, NX-900, LX2, LX5

Firmware version:

1.00 / 1.00.00


By using this function, it is possible to redirect, or copy, the raw NMEA sentences that have been received from the internal GPS receiver to a specific serial port on the RTCU device. This makes it possible to connect a PDA or similar to the serial port and be able to receive navigational data without investing in a separate GPS receiver. Please note that the serial port must be open and configured prior to calling this function. If the serial port that is to be used is configured for a baud rate lower than 4800 baud, the baud rate used will be 4800.

Please note that the NMEA sentences will only be forwarded to the specified port during the call of gpsFix(). It is therefore important that the function is called regularly.

 

The normal GPS function, gpsFix(), still continues to work regardless of this function.

 

 

Input:

port : SINT

This specifies which serial port to copy the NMEA data to. Please see the serOpen() for an explanation of allowed values.

 

enable : BOOL

TRUE:

The raw NMEA sentences will be copied to the serial port specified.

FALSE:

No NMEA sentences are copied.

 

Returns:

None.

 

Declaration:

FUNCTION gpsEnableNMEA;
VAR_INPUT
  port   : SINT;
  enable : BOOL;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
VAR
  portNum : SINT := 0;                   // Select which port to use for the communication        
  gps     : gpsFix;
END_VAR;
 
PROGRAM test;
 
// Turn on power to the GPS module
gpsPower(power := TRUE);
// Open the serial port, set baudrate, parity and number of bits
serOpen(port:=portNum, baud:=9600, bit:=8, parity:=0);
// Enable NMEA output on the serial port
gpsEnableNMEA(port:=PortNum, enable:=TRUE);
 
BEGIN
  ...
  gps();
  ...
END;
 
END_PROGRAM;