navUserStatusReceive (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


navUserStatusReceive returns the user status and timestamp.

 

If the navigation device support API level 2, additional information can be received with navUserStatusRcvX.

 

Note that the user status is only valid after a "User Status" event is raised; the event will be removed when this function block is called.

A "User Status" event is raised when the user status is changed in the navigation device or is requested with navUserStatusRequest.

 

 

Input:

None.

 

 

Output:

time : DINT

The timestamp when the specified user status took effect.

 

status : INT

The ID used to identify the user status in navUserStatusDefine.

-1 if no status is set.

 

ready : BOOL

TRUE:

If data is ready.

FALSE:

If data is not ready.

 

Declaration:

FUNCTION_BLOCK navUserStatusReceive;
VAR_OUTPUT
  time   : DINT;
  status : INT;
  ready : BOOL;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  userStatus : navUserStatusReceive;
END_VAR;
 
FUNCTION ReadUserStatus;
  userStatus();
  IF userStatus.ready THEN
    DebugMsg(message := "*** user status received ***");
    DebugFmt(message := "-time=\4", v4 := userStatus.time);
    DebugFmt(message := "-status=\1", v1 := userStatus.status);
  END_IF;
END_FUNCTION;
 
THREAD_BLOCK navMonitor;
VAR
  event : INT := 0;
END_VAR;
 
WHILE event <> -1 DO
  event := navWaitEvent(timeout := -1);
  CASE event OF
     ...
    7: ReadUserStatus();
     ...
  END_CASE;
END_WHILE;
END_THREAD_BLOCK;