DELETE block
Short summary
Name |
|
→POU type |
|
Category |
|
Conform to →IEC-standard |
currently restricted
|
Graphical interface |
|
Available since |
version 1.31.0 (for Neuron Power Engineer) |
Functionality
The block deletes a part of a string and returns the newly created string.
At input IN
, enter a string. At input L
, enter the number of characters to delete (= the length of the part to delete). At input P
, enter the start position. The block begins at this position to deletes the characters.
Special cases (see under "Example for usage within ST-editor"):
-
In case of
L = 0
, the block does not delete any characters. I.e., the block returns the string as connected toIN
. In this case, the outputENO
is set to valueTRUE
. -
If a negative value is connected to
L
, the corresponding characters before the positionP
are deleted in the string. In this case, the outputENO
is set to valueFALSE
. If the block would delete characters outside of the visible range (in front of position 1), the block does not delete any characters. -
If the value
0
or a negative value is connected toP
, the block does not delete any characters. In this case, the outputENO
is set to valueFALSE
as well. -
If the value for
L
and/orP
is > the length of the string forIN
, the block does not delete any characters or just the characters that are within the visible range. In this case, the outputENO
is set to valueFALSE
as well.
Neuron Power Engineer determines the character positions within a string as follows: 1
, 2
, ..., n. 1
corresponds to the leftmost character position and n
to the length of the string.
Three-character combination of the dollar sign ($
) followed by two hexadecimal digits are evaluated as single character. Example: The string '$B15
' (corresponds to '±5
') consists of 2 characters. See →character string literal for more examples for those combinations.
Inputs, return value
|
Identifier |
Description |
|
---|---|---|---|
Inputs: |
|
|
input value (= string where to delete) |
|
|
number of characters to delete |
|
|
|
start position in the input value |
|
Return value: |
– |
|
|
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
The block checks the would-be return value.
If the return value cannot be mapped in the available memory (the return value is too large), the output ENO
of the block is set to value FALSE
(or an equivalent). When you are using nested blocks with STRING
values, observe that the memory for STRING
values is restricted (see "In case of nested string blocks: How can the return value be entirely mapped ?" for details and examples).
Moreover, the block checks the connected values whether a non-existent character position in a string is accessed. This is the case, if the value for L
or P
is > the length of the string value for IN
, a negative value is connected to L
or P
or the value 0
is connected to P
. The output ENO
of the block is set to value FALSE
(or an equivalent) in all these cases.
Example for usage within ST-editor
|
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.