Secured String Print Formatted Block Description
This block converts signals into an ASCII character string according to a predefined format. Internally, it utilizes the C standard library function snprintf(). The number and data types of the inputs 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 |
|---|---|---|
| Input 1…N | Format-dependent | Conditional input Values used to construct the output string. The total number of inputs and their respective types are dynamically evaluated based on the snprintf() formatting configurations. The quantity and types depend directly on the ASCII String parameter. |
Outputs
| Output Name | Type | Description |
|---|---|---|
| Data | uint8[ ] | A null-terminated ('\0') ASCII character string generated according to the ASCII String formatting constraints. |
Block Parameters
| Parameter | Description |
|---|---|
| Output Vector Size | The maximum allowable length of the generated character string (including the trailing null terminator '\0'). This value defines the memory buffer size allocated to the internal snprintf() function routine. |
| ASCII String | The formatting string expression following standard snprintf() syntax rules. Each individual format specifier maps sequentially to a dedicated block input port.Specifier Syntax Structure (e.g., %10.2f):• 10 – Minimum field width. Values shorter than this constraint are padded with spaces.• .2 – Fractional precision boundary specifying decimal places for floating-point numbers.• 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[]).Every specifier automatically creates one input port on the block. Standard alphanumeric characters or symbols (such as spaces, commas, or semicolons) present in the string are preserved and copied directly into the output text stream. |
| Sample Time | Specifies the software cyclic execution update interval for the block in seconds. |

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