Please enable JavaScript to view this site.

How this block appears in a Simulink model?

print_block_1

What can be configured?

print_block_2

Configuration Parameter

Selectable Option/Value

Description

String input type

String variable--Character vector

Select the input type.

Sample time (sec)

-1 (inherited) or specify

Specify the sample time

INPUT/ OUTPUT Port

Port Name

Port Type

Date Type

Description

Input port

Scalar/Vector

string/uint8

Input data that should be printed on the serial monitor

When to use this block?

This block can be used to print data to a serial monitor.

How does this block work?

This block uses the C library function int printf(const char *format, ...) to send formatted output to stdout.

Demo

Demo file : esp32_string_processing_demo.slx

string_processing_block_8
string_processing_block_9

Description

This example shows how to use the String Processing Block on ESP32. In this example, sprintf and sscanf functions are used.

Setup

A serial monitor software application is required to get the expected results. For this example, PuTTY open-source SSH and telnet client is used to monitor the serial output.

What should be happening?

After the model file is compiled and uploaded to the ESP32 board, open the PuTTY software and connect to the relevant serial port with a baud rate of 115200. The following output should be visible on the serial monitor software.

string_processing_block_10

 

Copyright 2022 Aimagin Co.,Ltd. Rev.507