serial.read_text

serial.read_text

serial.read_text

Function

Read data from the open serial port and convert it to a string strictly according to UTF-8.

Syntax

Parameters

No parameters.

Return value

TypeDescription
String/NullLegal UTF-8 returns String; illegal UTF-8 returns null.

Code Example

Notes

  • read_text() does not use lossy conversion; please use read_bytes() for industrial protocol messages.