--- title: "system.serial.openSerialPort" description: "Opens a previously configured serial port for use." --- # system.serial.openSerialPort > Opens a previously configured serial port for use. This function is used in **Python Scripting**. ## Description Opens a previously configured serial port for use. Will throw an exception if the serial port cannot be opened. ## 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.openSerialPort(port)` ### Parameters Type | Parameter | Description ------- | ------- | ------ String | `port` | The name of the serial port, e.g., "COM1" or "dev/ttyS0". ### Returns Nothing ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet - Using a Literal Value" # This example will open a port called "COM1" system.serial.openSerialPort("COM1") ``` ```python title="Code Snippet - Using a Variable" # This example will open a port using a variable called port that has a value of "COM1" port = "COM1" system.serial.openSerialPort(port) ```