FC_SemaphoreMeGive - General Information
Type: |
Function |
Available as of: |
V1.0.7.0 |
Versions: |
Current version |
Enable a Semaphore
The function executes the Give() operation on the specified semaphore. Give() may only be executed by the task that possesses the semaphore or that executed Take().
If other tasks on the semaphore are blocked, the one with the highest priority is awakened. In the event that no tasks are waiting for the semaphore, the semaphore switches to the "full" state.
Accordingly, in cases in which a task with higher priority (Task2) than the task calling up Give() (Task1) is waiting for the semaphore, a task switch takes place. The execution of Task1 is paused and the execution of Task2 continues.
For restrictions for use see Notes on Using the "SemaphoreMutualExclusion" Function.
Output |
Data type |
Description |
---|---|---|
q_etDiag |
General library-independent statement on the diagnostic. A value not equal to ET_Diag.Ok corresponds to an diagnostic message. |
|
q_etDiagExt |
POU-specific output on the diagnostic. q_etDiag = ET_Diag.Ok -> Status message q_etDiag <> ET_Diag.Ok -> Diagnostic message |
Input/Output |
Data type |
Description |
---|---|---|
iq_stSemMe |
Structure of the semaphores to be released |
Data type |
Description |
---|---|
BOOL |
TRUE: the semaphore has been successfully released. FALSE: the semaphore has not been released. |
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
OK |
0 |
Ok |
|
InputParameterInvalid |
266 |
SemaphoreMe is not initializd. |
|
UnexpectedProgramBehavior |
271 |
Releasing the SemaphoreMe was unsuccessful. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Ok |
The semaphore has been successfully released.
Enumeration name: |
SemaphoreMeGiveFailed |
Enumeration value: |
271 |
Description: |
Releasing the SemaphoreMe was unsuccessful. |
Issue |
Cause |
Solution |
---|---|---|
- |
An error occurred in the internal execution. |
Please inform the support team about this error. |
Enumeration name: |
SemaphoreMeNotInitialized |
Enumeration value: |
266 |
Description: |
SemaphoreMe is not initializd. |
Issue |
Cause |
Solution |
---|---|---|
- |
The semaphore is not initialized. |
Transfer the same semaphore which was used during call-up of FC_SemaphoreMeCreate at the iq_stSemMe input. |