- 131 -
[
[
[
[
F
F
u
u
n
n
c
c
t
t
i
i
o
o
n
n
a
a
l
l
d
d
e
e
s
s
c
c
r
r
i
i
p
p
t
t
i
i
o
o
n
n
]
]
]
]
This service call receives a message from the mailbox indicated by mbxid and stores the start address of the received mes-
sage in the area pointed to by ppk_msg. T_MSG** should be specified with a 32-bit address. If data is present in the tar-
get mailbox, the data at the top of the mailbox is received.
On the other hand, if rcv_mbx or trcv_mbx is issued for a mailbox that has no messages in it, the task that issued the ser-
vice call goes from RUNNING state to a message reception wait state, and is enqueued in a message reception waiting
queue. In that case, if the attribute of the specified mailbox is TA_TFIFO, the task is enqueued in order of FIFO; if
TA_TPRI, the task is enqueued in order of priority. For prcv_mbx and iprcv_mbx, the task returns immediately and re-
sponds to the call with the error code E_TMOUT.
For the trcv_mbx service call, specify a wait time for tmout in ms units. The values specified for tmout must be within
0x7FFFFFFF. If any value exceeding this limit is specified, the service call may not operate correctly. If TMO_POL=0 is
specified for tmout, it means specifying 0 as a timeout value, in which case the service call operates the same way as
prcv_mbx. Furthermore, if specified as tmout=TMO_FEVR(–1), it means specifying an infinite wait, in which case the
service call operates the same way as rcv_mbx.
The task placed into WAITING state by execution of the rcv_mbx or trcv_mbx service call is released from WAITING state
in the following cases:
When the rcv_mbx, trcv_mbx, prcv_mbx, or iprcv_mbx service call is issued before the tmout
time elapses, with task-awaking conditions thereby satisfied
The error code returned in this case is E_OK.
When the first time tick occurred after tmout elapsed while task-awaking conditions remain un-
satisfied
The error code returned in this case is E_TMOUT.
When the task is forcibly released from WAITING state by the rel_wai or irel_wai service call is-
sued from another task or a handler
The error code returned in this case is E_RLWAI.
If this service call is to be issued from task context, use rcv_mbx,trcv_mbx,prcv_mbx; if issued from non-task context, use
iprcv_mbx.