Documentation

ASCII to String

Uint8 vector signal to string signal

  • 库:
  • Simulink / String

Description

TheASCII to Stringblock 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".

Ports

Input

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 parameterBuffer size of dynamically-sized string (bytes)(256by default), theASCII to Stringblock truncates the string output to the buffer size-1 (for example,255), for generated code. To avoid truncation, increase the value of theBuffer size of dynamically-sized string (bytes)configuration parameter.

Example:[088 099]

Data Types:uint8

Output

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

base integer

Multidimensional Signals

No

Variable-Size Signals

No

Introduced in R2018a

Was this topic helpful?