Main Content

ASCII to String

Uint8 vector signal to string signal

  • ASCII to String block

Simulink / String


The ASCII to String block converts uint8 vector signals to string signals. The block treats each element in the input vector as an ASCII value during the conversion. For example, the block converts an input vector of [72 101 108 108 111] to the string "Hello".



expand all

ASCII signal, specified as a vector.

While using dynamic strings, if the length of the input vector exceeds the number of characters specified in the configuration parameter Buffer size of dynamically-sized string (bytes) (256 by default), the ASCII to String block truncates the string output to the buffer size-1 (for example, 255), for generated code. To avoid truncation, increase the value of the Buffer size of dynamically-sized string (bytes) configuration parameter.

Example: [088 099]

Data Types: uint8


expand all

Converted string signal from input ASCII signal, specified as a scalar. The block converts each ASCII element in the vector into its alphanumeric equivalent and outputs all elements concatenated into one string.

Data Types: string

Block Characteristics

Data Types

integer | string

Direct Feedthrough


Multidimensional Signals


Variable-Size Signals


Zero-Crossing Detection


Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2018a