trcv_dtq

Outline

Receive from data queue (with timeout).

C format

 ER      trcv_dtq (ID dtqid, VP_INT *p_data, TMO tmout);
Parameter(s)

I/O

Parameter

Description

I

 ID      dtqid;
ID number of the data queue from which a data element is received.

O

 VP_INT  *p_data;
Data element received from the data queue.

I

 TMO     tmout;
Specified timeout (unit:millisecond).

TMO_FEVR: Waiting forever.

TMO_POL: Polling.

Value: Specified timeout.



Explanation

This service call reads data in the data queue area of the data queue specified by parameter dtqid and stores it to the area specified by parameter p_data.

If no data could be read from the data queue area of the target data queue (no data has been written to the data queue area) when this service call is issued, the service call does not read data but queues the invoking task to the reception wait queue of the target data queue and moves it from the RUNNING state to the WAITING state with time out (data reception wait state).

The receiving WAITING state for a data queue is cancelled in the following cases, and then moved to the READY state.

Receiving WAITING State for a Data Queue Cancel Operation

Return Value

Data was written to the data queue area of the target data queue as a result of issuing snd_dtq.

E_OK

Data was written to the data queue area of the target data queue as a result of issuing psnd_dtq.

E_OK

Data was written to the data queue area of the target data queue as a result of issuing ipsnd_dtq.

E_OK

Data was written to the data queue area of the target data queue as a result of issuing tsnd_dtq.

E_OK

Data was written to the data queue area of the target data queue as a result of issuing fsnd_dtq.

E_OK

Data was written to the data queue area of the target data queue as a result of issuing ifsnd_dtq.

E_OK

Forced release from waiting (accept rel_wai while waiting).

E_RLWAI

Forced release from waiting (accept irel_wai while waiting).

E_RLWAI

Polling failure or timeout.

E_TMOUT



Note 1 Invoking tasks are queued to the reception wait queue of the target data queue in the order of the data reception request.

Note 2 If the data reception wait state is cancelled because rel_wai or irel_wai was issued or the wait time elapsed, the contents in the area specified by parameter p_data become undefined.

Note 3 TMO_FEVR is specified for wait time tmout, processing equivalent to rcv_dtq will be executed. When TMO_POL is specified, processing equivalent to prcv_dtq /iprcv_dtq will be executed.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- tmout < TMO_FEVR

E_ID

-18

Invalid ID number.

- dtqid < 0x0

- dtqid > Maximum ID number

E_CTX

-25

Context error.

- This service call was issued from a non-task.

- This service call was issued in the CPU locked state.

- This service call was issued in the dispatching disabled state.

E_NOEXS

-42

Non-existent object.

- Specified data queue is not registered.

E_RLWAI

-49

Forced release from the WAITING state.

- Accept rel_wai/irel_wai while waiting.

E_TMOUT

-50

Timeout.

- Polling failure or timeout.