navETAReceive (Functionblock)

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, LX2, LX4, LX5

Firmware version:

1.40 / 1.00.00

Nav. API level:

1


This function block returns information about the Estimated Time of Arrival.

Note that the ETA is only valid after an "ETA" event is raised; the event will be removed when this function block is called.

An "ETA" event is raised: when the navigation device calculates a route to the active destination, at regular intervals (when enabled with navETAAutoSet), or when requested with navETARequest.

 

 

Input:

None.

 

 

Output:

time : DINT

The estimated time of arrival for destination.

 

distance : DINT

The distance in meters from the current position to the active destination.

-1 if no destination is active.

 

latitude : DINT

The latitude of the active destination.

 

longitude : DINT

The longitude of the active destination.

 

ID : INT

The unique ID of the active destination.

-1 if stop is not set with navStopSet.

 

ready : BOOL

TRUE:

If data is ready.

FALSE:

If data is not ready.

 

Declaration:

FUNCTION_BLOCK navETAReceive;
VAR_OUTPUT
  time     : DINT;
  distance : DINT;
  latitude : DINT;
  longitude : DINT;
  ID       : INT;
  ready     : BOOL;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  etaRcv : navETAReceive;
END_VAR;
 
FUNCTION ReadETA;
  etaRcv();
  IF etaRcv.ready THEN
    DebugMsg(message := "*** ETA received ***");
    DebugFmt(message := "-time=\4", v4 := etaRcv.time);
    DebugFmt(message := "-distance=\4", v4 := etaRcv.distance);
    DebugFmt(message := "-stop=\1", v1 := etaRcv.id);
    DebugFmt(message := "-latitude=\4", v4 := etaRcv.latitude);
    DebugFmt(message := "-longitude=\4", v4 := etaRcv.longitude);
  END_IF;
END_FUNCTION;
 
THREAD_BLOCK navMonitor;
VAR
  event : INT := 0;
END_VAR;
 
WHILE event <> -1 DO
  event := navWaitEvent(timeout := -1);
  CASE event OF
     ...
    4: ReadETA();
     ...
  END_CASE;
END_WHILE;
END_THREAD_BLOCK;