SEMA block
Short summary
Name |
SEMA |
→POU type |
|
Category |
|
Conform to →IEC-standard |
not defined in IEC-standard |
Graphical interface |
|
Available since |
version 1.27.0 (for logi.CAD 3) |
Functionality
The block represents a semaphore.
If input CLAIM is →turned on, output BUSY returns value TRUE (or an equivalent) starting with the next executed cycle. If input RELEASE is turned on, output BUSY returns value FALSE (or an equivalent) .
In-/outputs
|
Identifier |
Description |
|
Inputs: |
CLAIM |
BOOL |
set (dominant) |
RELEASE |
BOOL |
reset |
|
Outputs: |
BUSY |
BOOL |
|
Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
See:
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic .
Example for usage within ST-editor
PROGRAM Test
VAR
mySEMA : SEMA;
TriggerC : BOOL;
TriggerR : BOOL;
Out : BOOL;
END_VAR
mySEMA(CLAIM := TriggerC, RELEASE := TriggerR, BUSY => Out);
(* Instance of block
'SEMA'
is called. *)
(* Input
'CLAIM'
gets value from
'TriggerC'
variable. Input
'RELEASE'
gets value from
'TriggerR'
variable.*)
(* Output
'BUSY'
returns TRUE,
if
'TriggerC'
is TRUE. Output
'BUSY'
returns FALSE,
if
'TriggerR'
is TRUE and
'TriggerC'
is FALSE. *)
(* Variable
'Out'
accesses the output
'BUSY'
. *)
END_PROGRAM
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.