sema

PLCopen motion icon

 Function Block - Semaphore.

The function block implements this algorithm:

    BUSY := mem;
    if CLAIM then
       mem := TRUE;
    else if RELEASE then
       BUSY := FALSE;
       mem := FALSE;
    end_if;

Inputs

Input

Data Type

See Data Types.

Range

Unit

Default

Description

CLAIM

BOOL

FALSE, TRUE

 

 

Takes the semaphore.

RELEASE

BOOL

FALSE, TRUE

 

 

Releases the semaphore.

Outputs

Output

Data Type

See Data Types.

Range

Unit

Description

BUSY

BOOL

FALSE, TRUE

 

TRUE if semaphore is busy.

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the input rung is the CLAIM command.
    • The output rung is the BUSY output signal.

IL Language Example

Not available.

ST Language Example

(* MySema is a declared instance of SEMA function block *)
MySema (CLAIM, RELEASE);
BUSY := MyBlinker.BUSY;