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


navUserIDReceive returns the user ID and timestamp.

 

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.

 

navUserIDReceive automatically authenticates a user ID when this is required.

For manual authentication, use navUserIDReceiveX and navUserIDAuthenticate.

 

 

Input:

None.

 

 

Output:

time : DINT

The timestamp when the specified user ID took effect.

 

user : STRING

The user ID.

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

 

ready : BOOL

TRUE:

If data is ready.

FALSE:

If data is not ready.

 

Declaration:

FUNCTION_BLOCK navUserIDReceive;
VAR_OUTPUT
  time : DINT;
  user : STRING;
  ready : BOOL;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  userID : navUserIDReceive;
END_VAR;
 
FUNCTION ReadUserID;
  userID();
  IF userID.ready THEN
    DebugMsg(message := "*** user ID received ***");
    DebugFmt(message := "-time=\4", v4 := userID.time);
    DebugMsg(message := "-user=" + userID.user);
  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;