sema
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
CLAIM |
BOOL |
|
|
|
Takes the semaphore. |
RELEASE |
BOOL |
|
|
|
Releases the semaphore. |
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
BUSY |
BOOL |
|
|
TRUE if semaphore is busy. |
Remarks
The function block implements this algorithm:
BUSY := mem;
if CLAIM then
mem := TRUE;
else if RELEASE then
BUSY := FALSE;
mem := FALSE;
end_if;
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
(* MySema is a declared instance of SEMA function block *)
Op1: CAL MySema (CLAIM, RELEASE)
FFLD MyBlinker.BUSY
ST BUSY
ST Language Example
(* MySema is a declared instance of SEMA function block *)
MySema (CLAIM, RELEASE);
BUSY := MyBlinker.BUSY;