Parser String Scan Formatted Block Description
This block converts an ASCII character string into numerical or textual values according to a predefined format. Internally, it utilizes the C standard library function sscanf(). The number and data types of the outputs are automatically determined based on the specified format string.

Table of Contents
- Inputs
- Outputs
- Block Parameters
- CubeMX Configuration for a Given MCU Model
- Application Example
- See Also
Inputs
| Input Name | Type | Description |
|---|---|---|
| String | uint8[] | A null-terminated ('\0') ASCII character string stored in an array, containing the data payload to be parsed. |
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | The number of successfully parsed fields. A value matching the total count of format specifiers indicates successful processing of the entire string sequence. |
| Output 1…N | Format-dependent | Conditional output Data parsed and extracted from the input character string. The number of active output ports and their respective data types are dynamically evaluated based on the sscanf() formatting configurations. The quantity and types depend directly on the ASCII String parameter. |
Block Parameters
| Parameter | Description |
|---|---|
| ASCII String | Parameter Description The parsing format string expression following standard sscanf() syntax rules. Each individual format specifier automatically creates one output port on the block and dictates its target data type.Specifier Syntax Structure (e.g., %10.2f):• 10 – Maximum number of characters to be processed for this field.• .2 – Precision constraint matching standard sscanf() (for floating-point numbers, this typically does not affect parsing behavior).• f – Data type conversion flag.Supported Specifiers: • %f – Decimal floating-point notation; e.g., 12.34, -5.6 (single).• %e – Scientific notation floating-point; e.g., 1.23e+03, -5.6e-02 (single).• %g – Compact decimal or scientific floating-point; e.g., 12.34 or 1.234e+04 (single).• %d – Signed decimal integer; e.g., -25, 1024 (int32).• %u – Unsigned decimal integer; e.g., 25, 1024 (uint32).• %ld – Long decimal integer; e.g., 123456 (int32).• %llu – Unsigned long long decimal integer; e.g., 1234567890123 (uint64).• %x, %X – Unsigned hexadecimal notation; e.g., 1A3F, FF, 0xFF (uint32).• %s – Character string terminated by a space or null byte; e.g., STM32 (uint8[]).Spaces in the format layout map directly to delimiters parsing individual items out of the raw input stream. The total count of specifiers corresponds exactly to the number of active block output ports. |
| Sample time | Specifies the software cyclic refresh execution update interval for the block. |

CubeMX Configuration for a Given MCU Model
Application Example
| ASCII String | String | Output 1 | Output 2 | Output 3 | Output 4 |
|---|---|---|---|---|---|
%f %e %g %u | 12.34 1.234e+02 5.6 123 | 12.34 | 123.4 | 5.6 | 123 |
See Also
Last updated on