Function Block - Semaphore.

Inputs

Input

Data type

Description

CLAIM

BOOL

Takes the semaphore.

RELEASE

BOOL

Releases the semaphore.

Outputs

Output

Data type

Description

BUSY

BOOL

TRUE if semaphore is busy.

Remarks

The function block implements the following algorithm:

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

In LD language, the input rung is the CLAIM command. The output rung is the BUSY output signal.

ST Language

MySema is a declared instance of SEMA function block:

MySema (CLAIM, RELEASE);
BUSY := MySema.BUSY;

FBD Language

Fixed_Image

LD Language

Fixed_Image


Created with the Personal Edition of HelpNDoc: Why Microsoft Word Isn't Cut Out for Documentation: The Benefits of a Help Authoring Tool