Find the right serial port name
To communicate with a device, you first need to open the serial port that it's connected to. Before that, you need to know the name of the serial port to use. Select your operating system to find instructions for determining the serial port name:
Operating system:
- Open Windows Device Manager.
- Find "Ports (COM & LPT)" in the list.
- Expand "Ports (COM & LPT)" to see the names of all serial ports.
The title of your serial port depends on the way you connect the device to the computer:
Type of connection | Example title |
---|---|
Onboard serial port of the computer | Communications Port (COM3) |
USB to Serial adaptor, such as Zaber's X-USBDC connector | USB Serial Port (COM3) |
Direct USB connection on a standalone controller | X-MCB2 (COM3) |
In any case, the port name is the text in brackets (i.e. COM3
in the previous examples).
If there are multiple ports that look like they may be valid, you may need to try them to see which connection works.
See a video of how to find the port name.
Enter the following command in a terminal:
ls /dev | grep -E 'ttyUSB|ttyACM'
# Example output:
# ttyUSB0
If you are using USB to connect your devices, the output will likely be ttyUSB0
. The port name is the output with the directory included: /dev/ttyUSB0
.
Enter the following command in a terminal:
ls /dev/tty.*
# Example output:
# tty.usbserial-A4017DXH
If you are using USB to connect your devices, the output will look something like tty.usbserial-A4017DXH
. The port name is the output with the directory included: /dev/tty.usbserial-A4017DXH
.