Open a serial device.
open_serial opens a serial device. The name of the device is determined by the parameter PortName and is operating system specific. On Windows NT machines, 'COM1'-'COM4' is typically used, while on Unix systems the serial devices usually are named '/dev/tty*'. The parameters of the serial device, e.g., its speed or number of data bits, are set to the system default values for the respective device after the device has been opened. They can be set or changed by calling set_serial_param.
|
PortName (input_control) |
filename.named -> string |
| Name of the serial port. | |
| Default value: ''COM1'' | |
| Suggested values: ''COM1'', ''COM2'', ''COM3'', ''COM4'', ''/dev/ttya'', ''/dev/ttyb'', ''/dev/tty00'', ''/dev/tty01'', ''/dev/ttyd1'', ''/dev/ttyd2'', ''/dev/cua0'', ''/dev/cua1'' | |
|
SerialHandle (output_control) |
serial_id -> integer |
| Serial interface handle. | |
If the parameters are correct and the device could be opened, the operator open_serial returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.
open_serial is reentrant and processed without parallelization.
set_serial_param, read_serial, write_serial, close_serial
set_serial_param, get_serial_param, open_file
System