Byte Pack
Converting input signals to a vector UInt8.
blockType: BytePack
Path in the library:
|
Description
Block Byte Pack accepts input signals of one or more data types and converts them into a single vector UInt8 for withdrawal. The block parameters allow you to set the data type of the input signals and the alignment of the data in the vector that outputs the block.
Ports
Output
#
OUT_1
—
converted signal data
vector
Details
Transformed block input data returned as a data vector UInt8.
| Data types |
|
| Complex numbers support |
I don’t |
Input
#
IN_1
—
signals for conversion
Float64 type signal (by default) | signal data array
Details
An array of input signals of one or more data types.
| Data types |
|
| Complex numbers support |
I don’t |
Parameters
Parameters
#
Output port (packed) data type —
block output data type
UInt8 | UInt16 | UInt32
Details
Specify the Engee data type for the output signal.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
# Input port data types — data types of block input signals
Details
Specify the Engee data types for the input signals received by the block in the cell array. In the array of cells, specify the data types in the order in which the input port of the block receives signal data. For example, if the block receives the data in order UInt32, UInt32, UInt16, Float64, UInt8, Float64 and Float32, specify the following array of cells:
("UInt32","UInt32","UInt16","Float64","UInt8","Float64","Float32")
The block then indicates the number of block inputs.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
#
Byte alignment —
byte boundary for data type alignment
1 | 2 | 4 | 8
Details
Specify how to align the data types of the input data to form the output vector UInt8 in bytes. Alignment can be performed along borders 1, 2, 4 or 8 bytes. Depending on the alignment value, each signal value starts with boundaries that are multiples of the alignment value. Alignment algorithms for each element of the output vector start at the byte boundary specified by the alignment value. Byte alignment sets boundaries relative to the starting point of the vector.
To get as tight a package as possible without gaps between data types in various combinations of data types, select the value 1.
You can use several data types of different lengths. In such cases, two-byte alignment may result in single-byte gaps between values. UInt8 or Int8 and another type of data. In the packet implementation, the block copies the data to the output buffer one byte at a time.
For example, suppose you specify the following array of cells for the parameter Input port data types:
("UInt32","UInt32","UInt16","Float64","UInt8","Float64","Float32")
Suppose you set for the parameter Byte alignment value 2. Each new value starts at 2 a byte from the previous data boundary. If the signals are scalar values, then:
-
The first value of the signal in the vector starts with
0bytes. -
The second value of the signal starts with
2bytes. -
The third value of the signal starts with
4bytes. -
The fourth value of the signal starts with
6bytes. -
The fifth value of the signal starts with
8bytes. -
The sixth value of the signal starts with
10bytes. -
The seventh value of the signal starts with
12bytes.
The packing algorithm leaves a gap in 1 the byte between the data value UInt8 and a double-precision value.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |