navMessageReceive (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Firmware version:

1.40 / 1.00.00

Nav. API level:

1


navMessageReceive returns a text message received from the navigation device.

 

If the navigation device supports API level 2, additional information can be received with navMessageReceiveX.

 

Note that the text message is only valid after a "message received" event is raised; the event will be removed when this function block is called.

A "message received" event is raised when the user writes a text message or sends a quick message.

 

 

Input:

None.

 

 

Output:

time : DINT

The timestamp when the text message was sent from the navigation device.

 

message : STRING

The received text message.

 

ready : BOOL

TRUE:

If data is ready.

FALSE:

If data is not ready.

 

Declaration:

FUNCTION_BLOCK navMessageReceive;
VAR_OUTPUT
   time    : DINT;
   message : STRING;
   ready   : BOOL;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
   msgRcv : navMessageReceive;
END_VAR;
 
FUNCTION ReadMessage;
   msgRcv();
   IF msgRcv.ready THEN
      DebugMsg(message := "*** message received ***");
      DebugFmt(message := "-time=\4", v4 := msgRcv.time);
      DebugMsg(message := "-text=" + msgRcv.message);
   END_IF;
END_FUNCTION;
 
THREAD_BLOCK navMonitor;
VAR
   event : INT := 0;
END_VAR;
 
WHILE event <> -1 DO
   event := navWaitEvent(timeout := -1);
   CASE event OF
      ...
      2: ReadMessage();
      ...
   END_CASE;
END_WHILE;
END_THREAD_BLOCK;