Everything

ref_cyc

iref_cyc

Outline
Reference cyclic handler state.
C format
 ER      ref_cyc (ID cycid, T_RCYC *pk_rcyc);
 ER      iref_cyc (ID cycid, T_RCYC *pk_rcyc);
Parameter(s)
I/O
Parameter
Description
I
 ID      cycid;
ID number of the cyclic handler.
O
 T_RCYC  *pk_rcyc;
Pointer to the packet returning the cyclic handler state.

[Cyclic handler state packet: T_RCYC]
 typedef struct  t_rcyc {
     STAT    cycstat;        /*Current state*/
     RELTIM  lefttim;        /*Time left before the next activation*/
 } T_RCYC;

Explanation
Stores cyclic handler state packet (current state, time until the next activation, etc.) of the cyclic handler specified by parameter cycid in the area specified by parameter pk_rcyc.
- cycstat
Store the current state.
TCYC_STP: Non-operational state
TCYC_STA: Operational state
- lefttim
Stores the time until the next activation (in millisecond). When the target cyclic handler is in the non-operational state, lefttim is undefined.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_PAR
-17
Parameter error.
- pk_rcyc == NULL
E_ID
-18
Invalid ID number.
- cycid < 0
- cycid > VTMAX_CYH
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
Note When the iref_cyc is issued from task or the ref_cyc is issued from non-task, the context error is not detected and normal operation of the system is not guaranteed.
E_MACV
-26
Memory access violation. (only for ref_cyc)
- The operand-write access to the area indicated by pk_rcyc has not been permitted to the invoking task.
E_NOEXS
-42
Non-existent object.
- The cyclic handler specified by cycid does not exist.