FC_SemaphoreMeCreate - General Information
Type: |
Function |
Available as of: |
V1.0.7.0 |
Versions: |
Current version |
Creating a Semaphore
The function initializes a data structure of the type ST_SemaphoreMe. It creates a semaphore of the type MutualExclusion with the settings SEM_Q_PRIORITY and SEM_INVERSION_SAFE. The selected settings ensure that tasks waiting for the semaphore are enabled in their order of priority. In addition, this avoids the problem of "priority inversion".
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 |
|
q_sMsg |
STRING[80] |
Event-triggered message which gives more detailed information on the diagnostic state. |
Input/Output |
Data type |
Description |
---|---|---|
iq_stSemMe |
Structure to manage the created semaphores |
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
OK |
0 |
Ok |
|
ControllerConditionInvalid |
100 |
The controller is not supported. |
|
InputParameterInvalid |
272 |
The Id of the SemaphoreMe is invalid. |
|
UnexpectedProgramBehavior |
267 |
A symbol of the SemaphoreMe was not found. |
|
UnexpectedProgramBehavior |
1 |
An unintended detected error occurred during execution. |
Enumeration name: |
ControllerInvalid |
Enumeration value: |
100 |
Description: |
The controller is not supported. |
Issue |
Cause |
Solution |
---|---|---|
- |
The controller does not provide the required conditions. |
For more details, see q_sMsg output. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Ok |
The semaphores have been successfully created
Enumeration name: |
SemaphoreMeIdInvalid |
Enumeration value: |
272 |
Description: |
The Id of the SemaphoreMe is invalid. |
Issue |
Cause |
Solution |
---|---|---|
- |
The semaphore at the iq_stSemMe input is already in use. |
Use a different structure to create a second semaphore. Delete the semaphores with FC_SemaphoreMeDelete before creating the new semaphores. |
Enumeration name: |
SemaphoreMeSymbolNotFound |
Enumeration value: |
267 |
Description: |
A symbol of the SemaphoreMe was not found. |
Issue |
Cause |
Solution |
---|---|---|
- |
An error occurred in the internal execution. |
Please inform the support team about this error. |
Enumeration name: |
UnexpectedFeedback |
Enumeration value: |
1 |
Description: |
An unintended detected error occurred during execution. |
Issue |
Cause |
Solution |
---|---|---|
- |
An error occurred in the internal execution. |
Please inform the support team about this error. |