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

Firmware version:

2.20 / 1.00.00

Nav. API level:

2


navUserStatusRcvX is an extended version of navUserStatusReceive and returns the user status and timestamp.

 

If the navigation device does not support API level 2, the function will work as navUserStatusReceive, and extended data will not be accessible.

 

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.

 

index : INT

The index of the user.

 

status : INT

The ID used to identify the user status in navUserStatusDefine.

-1 if no status is set.

 

ready : BOOL

TRUE:

If user status event is read.

FALSE:

If user status event is not read.

 

Declaration:

FUNCTION_BLOCK navUserStatusRcvX;
VAR_OUTPUT
  time   : DINT;
  index : SINT;
  status : INT;
  ready : SINT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  userStatus : navUserStatusRcvX;
END_VAR;
 
FUNCTION ReadUserStatus;
  userStatus();
  IF userStatus.ready THEN
    DebugFmt(message := "*** status for user \1 received ***", v1 := userStatus.index);
    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;