Skip to main content
Skip table of contents

serial_get_info(id)

Features

This function reads the port information and device name of the connected USB to Serial.

Parameters

Parameter NameData TypeDefault ValueDescription

id

int

1

ID of "USB to Serial" to read (1-10)

Return

Value (port_info, device_name)Description

port_info

Port information (NULL means no device is connected)

device_name

Device name (NULL means no device is connected)

Exception

ExceptionDescription

DR_Error (DR_ERROR_TYPE)

Parameter data error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

Example

PY
port_info, device_name = serial_get_info(1) #1 connected device information 
#port_info = "COM_USB"
ser = serial_open(port=port_info, baudrate=115200, bytesize=DR_EIGHTBITS, 
          parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.