--- title: "system.serial.readBytes" description: "Read numberOfBytes bytes from a serial port." --- # system.serial.readBytes > Read numberOfBytes bytes from a serial port. This function is used in **Python Scripting**. ## Description Read `numberOfBytes` bytes from a serial port. ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.serial.readBytes(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 **List[Byte]** - A list containing bytes read from the serial port. ### Scope Gateway, Vision Client, Perspective Session ## Code Example ```python title="Code Snippet" # This example will read a specified number of bytes from a port called "COM1". port = "COM1" system.serial.readBytes("COM1",2) ```