System.SerialPort
From Xojo Documentation
This item was deprecated in version 2019r2. Please use SerialDevice as a replacement. |
Method
Gets the serial port by its index.
Method
Gets the serial port by its path.
Notes
On macOS and Linux, the path is the path to the device file corresponding to the serial device (e.g., /dev/ttyS0). On Windows, this can be the COM port you want to open, e.g.,
Serial1.SerialPort = System.SerialPort("/dev/ttyS0") // macOS and Linux
Serial1.SerialPort = System.SerialPort("COM1") // Windows
Serial1.SerialPort = System.SerialPort("COM1") // Windows
Examples
You get the values of SerialPort properties by accessing the properties of the System module:
TextField1.Text = System.SerialPort(0).InputDriverName
The following displays the names of the serial ports on the computer: