Wolfram Language & System 10.3 (2015)|Legacy Documentation
Serial (RS-232 / RS-422 serial protocol)
This feature is not supported on the Wolfram Cloud.
- The following options can be given:
"BaudRate" 9600 data transfer rate in bits per second "DataBits" 8 number of data bits to use per frame "Handshake" None the flow control handshake protocol "IgnoreBreak" False whether to ignore breaks "Parity" None setting for the parity bit "ReadBufferSize" 4096 size of the read buffer in bytes "StopBits" None number of stop bits to use
- Typical baud rate values include: , , , , , , .
- gives the number of bits in each byte used to carry data. Possible values are: , , , , .
- Possible settings for the flow control handshake protocol are: None, , .
- Possible values for , specifying how the parity bit should be set, are: None, , , , .
- gives the number of bits used to separate data frames. Possible values are: None, , , .
opens the default serial port.
opens the serial port with the specified name. Typical names on Unix-based systems are "/dev/ttyXX" or "/dev/tty.usbserialXX" and under Windows are "COM1", "COM2", etc.
opens the default serial port with the specified options.
- Wolfram Language functions such as DeviceReadLatest and DeviceReadTimeSeries are also supported.
- Bytes are represented in the Wolfram Language by their integer values.
- Lists of bytes can be converted to character strings using FromCharacterCode.
- The setting for can be a single byte or character.
- If no data is available to be read, the read functions will time out after a preset time of 10 seconds.
reads a single byte from the serial connection, returning an integer value.
reads all available bytes in the serial connection buffer, returning a list of integers.
reads the most recent n bytes in the serial connection buffer.
reads bytes from the serial port buffer until a terminator term.
- Wolfram Language functions such as DeviceWriteBuffer are also supported.
- Bytes can be specified either as integers between 0 and 255 or as single-character ASCII strings.
writes a byte b to the serial connection.
writes a list of bytes to the serial connection.
writes the bytes in a string to the serial connection.