--- title: "system.serial.readBytesAsString" description: "Read numberOfBytes bytes from a serial port and convert them to a String." --- # system.serial.readBytesAsString > Read numberOfBytes bytes from a serial port and convert them to a String. This function is used in **Python Scripting**. ## Description Read numberOfBytes bytes from a serial port and convert them to a String. If a specific encoding is needed to match the source of the data, use system.serial.readBytes and use the desired encoding to decode the byte array returned. ## Client Permission Restrictions This scripting function has no [Client Permission](projects\project-properties\project-properties.md#client---permissions) restrictions. ## Syntax `system.serial.readBytesAsString(port, numberOfBytes [, timeout])` ### Parameters |Type|Parameter|Description| |--|--|--| |String |`port` |The previously configured serial port to use.| |int |`numberOfBytes` |The number of bytes to read.| |int| `timeout`| Maximum amount of time, in milliseconds, to block before returning. Default is 5000. [optional]| ### Returns **String** - A String created from the bytes read. ### Scope All