PACK block
Short summary
Name |
|
→POU type |
|
Category |
|
Conform to →IEC-standard |
not defined in IEC-standard |
Graphical interface |
|
Available since |
version 1.50.0 (for Neuron Power Engineer) – initial variant version 3.2.5 (for library version 3.8.0 (for library version 3.8.0 (for library |
Functionality
The block returns the transferred values of the bytes connected to the inputs IN0
– IN7
. In case of target systems saving data in little →endian format, the byte of input IN0
is transferred to the lowest significant byte of the return value, the byte of input IN7
to the highest significant byte of the return value. A reversed behavior is true for target systems saving data in big endian format.
Special cases (see under "Example for usage within ST-editor"):
-
If the size of the result data type (number of bytes representing the data type) is > than the number of the connected input bytes, the higher significant bytes of the return value remain not-initialized.
In case ofBOOL
values for the return value,TRUE
is returned for each value ≠0
at inputIN0
. -
If more input bytes are connected than the result data type can hold, only the lower significant input bytes are transferred to the return value. In case of target systems saving data in little endian format, these are the inputs positioned in the upper part of the block.
The block reports an error whenthe output is connected to a block input of a generic data type (e.g. the input of a TO_INT
block). This behavior is caused due to the statement anyOutputMustBeConcreteResolved
in the interface of the PACK
block. See under "Properties for implementing vendor blocks" for details on this statement. To fix such an error, you might want to declare an auxiliary variable and assign the calls to this auxiliary variable (see under "Typing of expressions" for details on this workaround for a nested usage of PACK
together with other blocks).
Inputs, return value
|
Identifier |
Description |
|
---|---|---|---|
Inputs: |
|
|
1st value |
|
|
2nd value |
|
... (extensible until) |
|||
|
|
8th 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.
Example for usage within ST-editor
The following example is valid for target systems saving data in little endian format. 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.