Engee documentation

Byte Pack

Converting input signals to a vector UInt8.

blockType: BytePack

Path in the library:

/Basic/Additional/Interfaces/Byte Pack

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

UInt8, UInt16, UInt32

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

Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Bool

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

UInt8 | UInt16 | UInt32

Default value

UInt8

Program usage name

maskPackedDataType

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

[Float32]

Program usage name

datatypes

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 0 bytes.

  • The second value of the signal starts with 2 bytes.

  • The third value of the signal starts with 4 bytes.

  • The fourth value of the signal starts with 6 bytes.

  • The fifth value of the signal starts with 8 bytes.

  • The sixth value of the signal starts with 10 bytes.

  • The seventh value of the signal starts with 12 bytes.

The packing algorithm leaves a gap in 1 the byte between the data value UInt8 and a double-precision value.

Values

1 | 2 | 4 | 8

Default value

1

Program usage name

byteAlign

Tunable

No

Evaluatable

No