Everything

set_flg

iset_flg

Outline
Set eventflag.
C format
 ER      set_flg (ID flgid, FLGPTN setptn);
 ER      iset_flg (ID flgid, FLGPTN setptn);
Parameter(s)
I/O
Parameter
Description
I
 ID      flgid;
ID number of the eventflag to be set.
I
 FLGPTN  setptn;
Bit pattern to set.

Explanation
These service calls set the result of logical OR operating the bit pattern of the eventflag specified by parameter flgid and the bit pattern specified by parameter setptn as the bit pattern of the target eventflag.
If the required condition of the task queued to the target eventflag wait queue is satisfied when this service call is issued, the relevant task is unlinked from the wait queue at the same time as bit pattern setting processing.
As a result, the relevant task is moved from the WAITING state (WAITING state for an eventflag) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state.
Note 1 If the bit pattern set to the target eventflag is B'1100 and the bit pattern specified by parameter setptn is B'1010 when this service call is issued, the bit pattern of the target eventflag is set to B'1110.
Note 2 When the TA_WMUL attribute is specified for the target eventflag, the range of tasks to be checked on "whether issuing of this service call satisfies the required condition" differs depending on whether the TA_CLR attribute is also specified.
- When TA_CLR is specified
Check begins from the task at the head of the wait queue and stops at the first task that meets the requirements.
- When TA_CLR is not specified
All tasks placed in the wait queue are checked.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- flgid < 0x0
- flgid > Maximum ID number
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
E_NOEXS
-42
Non-existent object.
- Specified eventflag is not registered.