navStopSet (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2, AX9, CX1 pro/flex/warp, SX1, MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400, NX-900

Firmware version:

1.40 / 1.00.00

Nav. API level:

1


This function will set a destination in the navigation device.

When a destination is set, a small notification is presented.

 

The position of the destination must be given in the semicircle format.

Up to 20 destinations can be defined.

 

A semicircle is a unit of location-based measurement on an arc.

An arc of 180 degrees is made up of many semicircle units; 2^31 semicircles to be exact.

Semicircles that correspond to North latitudes and East longitudes are indicated with positive values;

semicircles that correspond to South latitudes and West longitudes are indicated with negative values.

 

The following formulas show how to convert between degrees and semicircles:

degrees = semicircles * (180 / 2^31)

semicircles = degrees * (2^31 / 180)

 

Note:

On some older models/firmware versions, and if a destination with the same ID already exists, the position and text will be updated. If the active destination is updated, the navigation device will recalculate the route to the new location.

Updating a destination does not change the status.

 

 

Input:

ID : INT

Unique ID to identify the destination when status is received.

Note: the ID of -1 is reserved and will result in an error.

 

latitude : DINT

The latitude of the position.

 

longitude : DINT

The longitude of the position.

 

text : STRING

A text comment to identify the destination in the route. Max. 199 characters.

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-7

- The selected ID is illegal.

-9

- A stop with this ID is already set.

-10

- The stop list is full.

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION navStopSet : INT;
VAR_INPUT
  ID       : INT;
  latitude : DINT;
  longitude : DINT;
  text     : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM NavigationExample;
 
BEGIN
  ...
  // Add a destination to the route
  navStopSet(id := 61, latitude := 666377598, longitude := 117525954, text := "Logic IO - main office");
  ...
END;
END_PROGRAM;