navUserIDReceiveX (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:

2.20 / 1.00.00

Nav. API level:

2


navUserIDReceiveX is an extended version of navUserIDReceive and returns the information of the user ID change.

 

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

A "User ID" event is raised when the user ID is changed in the navigation device or is requested with navUserIDRequest.

 

If the status indicates that the user ID requires authentication, then the navUserIDAuthenticate function must be called.

Failure to do this will result in the "User ID" event being raised in regular intervals by the navigation device.

 

 

Input:

None.

 

 

Output:

time : DINT

The timestamp when the specified user ID took effect.

 

index : SINT

The index of the user.

 

user : STRING

The ID of the user.

If no user ID has been set, the string will be empty.

 

password : STRING

The password of the user.

 

status : SINT

0

- User ID is not ready.

1

- User ID is ready, authentication is not required.

2

- User ID is ready, authentication is required.

 

Declaration:

FUNCTION_BLOCK navUserIDReceiveX;
VAR_OUTPUT
  time     : DINT;
  index   : SINT;
  user     : STRING;
  password : STRING;
  status   : BOOL;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  userID : navUserIDReceiveX;
END_VAR;
 
FUNCTION ReadUserID;
  userID();
  IF userID.status > 0 THEN
    DebugMsg(message := "*** user ID received ***");
    DebugFmt(message := "-time=\4", v4 := userID.time);
    DebugFmt(message := "-idx= \1", v1 := userID.index);
    DebugMsg(message := "-user=" + userID.user);
    DebugMsg(message := "-pass=" + userID.password);
  END_IF;
  IF userID.status = 2 THEN
    navUserIDAuthenticate(accept := TRUE);
  END_IF;
END_FUNCTION;
 
THREAD_BLOCK navMonitor;
VAR
  event : INT := 0;
END_VAR;
 
WHILE event <> -1 DO
  event := navWaitEvent(timeout := -1);
  CASE event OF
     ...
    6: ReadUserID();
     ...
  END_CASE;
END_WHILE;
END_THREAD_BLOCK;