navMessageReplyReceive returns the reply and timestamp for a text message.
Note that the message reply is only valid after a "message reply" event is raised; the event will be removed when this function block is called.
A "message reply" event is raised when the user replies to a text message.
Input:
None.
Output:
id : INT
The ID used to identify the text message in navMessageSend.
time : DINT
The timestamp for the reply.
reply : INT
The ID of the selected reply.
ready : BOOL
TRUE:
|
If data is ready.
|
FALSE:
|
If data is not ready.
|
Declaration:
FUNCTION_BLOCK navMessageReplyReceive;
VAR_OUTPUT
ID : INT;
time : DINT;
reply : INT;
ready : BOOL;
END_VAR;
Example:
INCLUDE rtcu.inc
VAR
msgAck : navMessageReplyReceive;
END_VAR;
FUNCTION ReadMessageReply;
msgAck();
IF msgAck.ready THEN
DebugMsg(message := "*** message reply received ***");
DebugFmt(message := "-msgid=\1", v1 := msgAck.ID);
DebugFmt(message := "-time=\4", v4 := msgAck.time);
CASE msgAck.reply OF
1: DebugMsg(message := "-reply=[OK]");
2: DebugMsg(message := "-reply=[YES]");
3: DebugMsg(message := "-reply=[NO]");
ELSE
DebugFmt(message := "-reply=\1", v1 := msgAck.reply);
END_CASE;
END_IF;
END_FUNCTION;
THREAD_BLOCK navMonitor;
VAR
event : INT := 0;
END_VAR;
WHILE event <> -1 DO
event := navWaitEvent(timeout := -1);
CASE event OF
1: ReadMessageReply();
...
END_CASE;
END_WHILE;
END_THREAD_BLOCK;
|