CHS block
Short summary
Name |
|
→POU type |
|
Category |
|
Conform to →IEC-standard |
not defined in IEC-standard |
Graphical interface |
|
Available since |
version 1.64.0 (for Neuron Power Engineer) |
Functionality
The block returns the value that is connected to the input IN
with a changed sign. If the value 0
is connected, the block returns 0
again.
Behavior for unsigned integer data types (= ANY_UNSIGNED
– see appropriate elementary data types for glossary item →generic data type):
-
The block returns an unsigned value. This value is formed as follows: The value connected to
IN
(if it is >0
) is subtracted from the upper limit of the appropriate data type, then the value1
is added:upper limit – IN + 1
See under "Example for usage within ST-editor".
As background information: The value connected toIN
is interpreted as bit pattern with sign. This signed value is converted (and returned as unsigned value again). -
Furthermore, the output
ENO
is set to valueFALSE
.
Behavior for other data types:
-
Applies to
ANY_SIGNED
: If the lower limit of the appropriate data type is connected toIN
, the block returns this value. Reason: The value with the changed sign is not allowed for the lower limit of the data type.
See under "Example for usage within ST-editor". -
Applies to
ANY_SIGNED
andANY_REAL
: The outputENO
is always set to valueTRUE
.
Inputs, return value
|
Identifier |
Description |
|
---|---|---|---|
Inputs: |
|
|
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 data type of the connected value before the block is executed.
In case of an unsigned integer data type (= ANY_UNSIGNED
), the output ENO
of the block is set to value FALSE
(or an equivalent).
Example for usage within ST-editor
The calculated values are evaluated by using the Assert
block.
|
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.