Everything

snd_dtq

Outline
Send to data queue (waiting forever).
C format
 ER      snd_dtq (ID dtqid, VP_INT data);
Parameter(s)
I/O
Parameter
Description
I
 ID      dtqid;
ID number of the data queue.
I
 VP_INT  data;
Data element to be sent to the data queue.

Explanation
This service call processes as follows according to the situation of the data queue specified by the parameter dtqid.
- There is a task in the reception wait queue.
This service call transfers the data specified by parameter data to the task in the top of the reception wait queue. As a result, the task is unlinked from the reception wait queue and moves from the WAITING state (data reception wait state) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state.
- There is no task neither in the reception wait queue and transmission wait queue and there is available space in the data queue.
This service call stores the data specified by parameter data to the data queue.
- There is no task neither in the reception wait queue and transmission wait queue and there is no available space in the data queue, or there is a task in the transmission wait queue.
This service call queues the invoking task to the transmission wait queue of the target data queue and moves it from the RUNNING state to the WAITING state (data transmission wait state).
The sending WAITING state for a data queue is cancelled in the following cases.
Sending WAITING State for a Data Queue Cancel Operation
Return Value
Available space was secured in the data queue area as a result of issuing rcv_dtq.
E_OK
Available space was secured in the data queue area as a result of issuing prcv_dtq.
E_OK
Available space was secured in the data queue area as a result of issuing iprcv_dtq.
E_OK
Available space was secured in the data queue area as a result of issuing trcv_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
The data queue is reset as a result of issuingissuing vrst_dtq.
EV_RST
Forced release from waiting (accept del_dtq while waiting).
E_DLT

Note 1 Data is written to the data queue area in the order of the data transmission request.
Note 2 Invoking tasks are queued to the transmission wait queue of the target data queue in the order specified at creating the data queue (FIFO order or current priority order).
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- dtqid < 0
- dtqid > VTMAX_DTQ
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.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
E_MACV
-26
Memory access violation.
- Stack pointer points out of user stack for invoking task.
E_NOEXS
-42
Non-existent object.
- The data queue specified by dtqid does not exist.
E_RLWAI
-49
Forced release from the WAITING state.
- Accept rel_wai/irel_wai while waiting.
E_DLT
-51
Waiting object deleted.
- Accept del_dtq while waiting.
EV_RST
-127
Released from WAITING state by the object reset (vrst_dtq)