BSGET, BSGETOCT – Binary Structure - Get a single value of given type

Block SymbolsLicensing group: ADVANCED
PIC PIC

Function Description
This group of blocks is used for obtaining values from a binary structure (byte array). The BSSET and BSSETOCT blocks can be used to write to the binary structure.
If binary structures are received using communication, it is possible to process them directly in the block mediating communication. Typically this is a REXLANG or PYTHON programmable block. Using structures, however, it is possible to transfer data within the REXYGEN application as well. The binary structure is fed in the form of an array (vector) of bytes to the uVec input. The uOffset input specifies the offset (in bytes) of the desired value from the beginning of the structure. The value type is specified by the type parameter.
The yOffset output is the start of the next element in the structure. This is advantageous for chaining: if the structure contains several elements in a row, it is possible to connect the input uOffset to the output yOffset of the previous block and it is not necessary to calculate the offset.
The only difference between the blocks is that BSGET gets a single value. The BSGETOCT block is able to receive up to 8 values (the number is determined by the m parameter).

Inputs

uVec

Binary Structure (array of bytes) input

Reference

uOffset

Offset to start in the input Binary Structure (in bytes)

Long (I32)

Outputs

yVec

Copy of the uVec input, for easy chaining

Reference

y

Scalar value output (scalar type defined by parameter)

Any

yOffset

Offset after the last processed byte of the input Binary Structure (in bytes), for easy chaining

Long (I32)

Parameters

m

Number of used values (for multi-blocks)   1  8 8

Long (I32)

BE

Big-Endian byte order (default is Little-Endian, e.g. Intel)

Bool

type

Data type of item   2  10 2

Long (I32)

2023 © REX Controls s.r.o., www.rexygen.com