FC_SemaphoreMeCreate

 

FC_SemaphoreMeCreate - General Information

Overview

Type:

Function

Available as of:

V1.0.7.0

Versions:

Current version

Task

Creating a Semaphore

Description

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.

Interface

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

q_etDiagExt

ET_DiagExt

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

ST_SemaphoreMe

Structure to manage the created semaphores

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

ControllerConditionInvalid

ControllerInvalid

100

The controller is not supported.

InputParameterInvalid

SemaphoreMeIdInvalid

272

The Id of the SemaphoreMe is invalid.

UnexpectedProgramBehavior

SemaphoreMeSymbolNotFound

267

A symbol of the SemaphoreMe was not found.

UnexpectedProgramBehavior

UnexpectedFeedback

1

An unintended detected error occurred during execution.

ControllerInvalid

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.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The semaphores have been successfully created

SemaphoreMeIdInvalid

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.

SemaphoreMeSymbolNotFound

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.

UnexpectedFeedback

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.