Assert block
Short summary
Name |
|
→POU type |
|
Category |
Standard (non-safe), UtilEnh functions, block with internal error diagnostic |
Graphical interface |
|
Available since |
version 1.50.0 (for Neuron Power Engineer) – initial variant version 2.0.8 (for library version 3.8.0 (for library |
Functionality
Use the Assert
block in order to make a statement about the state of an element in the application (e.g. a variable). Hence, you are able to recognize logical errors in your application and/or to check the compliance with specifications.
If the block input C
is evaluated with the value FALSE
(or an equivalent), this block traces a message. Moreover, the output ENO
of the calling →POU and of the Assert
block itself is set to value FALSE
(or an equivalent).
The message of the Assert
block is displayed in the following locations:
-
within the console of the →runtime system
The console of the runtime system is a command prompt that is opened when the runtime system is started and it displays the messages of the runtime system. -
within the PLC Logging view of Neuron Power Engineer – The advantage of this view is that its content is listed in tabular form.
Format of the message: Assertion failed in [calling POU,line]: condition
The information for [calling POU]
and condition
are output in the format of the generated C-code. If the length of the message exceeds 1024 characters, only Assertion failed
will be traced.
Inputs
|
Identifier |
Description |
|
---|---|---|---|
Inputs: |
|
|
condition; expected to be |
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.
Internal error diagnostic for block
Depending on the block input C
, the output ENO
of the block is set to value FALSE
(or an equivalent).
Example for usage within ST-editor
|
The following messages are traced for this example:
|
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.