navAvoidAreaCreate (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Device support:

MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400, NX-900, LX2, LX4, LX5

Firmware version:

4.70 / 1.30.00

Nav. API level:

13


This function will create or modify an avoidance area on the navigation device.

Avoidance areas are areas that the routing will avoid and can e.g. be used to avoid road construction that is not reported by the traffic service.

The area is a rectangle defined by two diagonal corners.

 

 

Input:

id : INT

Unique ID to identify this area.

 

enable : BOOL (default TRUE)

Determines if the area is enabled by default.

 

name : STRING

The name of the area. Must be unique. Max. 48 characters.

 

lat_min : DINT

The latitude of the first corner.

 

lon_min : DINT

The longitude of the first corner.

 

lat_max : DINT

The latitude of the second corner.

 

lon_max : DINT

The longitude of the second corner.

 

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-4

- The navigation device rejected the command.

-7

- The name is already used by another area.

-8

- Invalid name.

-10

- There is not space for any more avoidance areas.

-11

- Avoidance areas are not supported.

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION navAvoidAreaCreate : INT;
VAR_INPUT
  ID     : DINT;
  enable : BOOL := TRUE;
  name   : STRING;
  lat_min : DINT;
  lat_max : DINT;
  lon_min : DINT;
  lon_max : DINT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM NavigationExample;
 
BEGIN
  ...
  // Create an avoidance area
  navAvoidAreaCreate(id := 1, enable := TRUE, name := "Road construction",
        lat_max := navPositionToSemicircles(pos := 55514600),
        lon_min := navPositionToSemicircles(pos := 9507940),
        lat_min := navPositionToSemicircles(pos := 55515120),
        lon_max := navPositionToSemicircles(pos := 9509200)
     );
  ...
END;
END_PROGRAM;