Table of Contents >Quanser Rapid Control Prototyping Toolkit >Communication Protocols >
Serial Protocol
The serial communications protocol supports communications over a standard serial port.
Syntax
serial://hostname:port?option=value,... % Access serial port "port" using specified options
Description
The serial communications protocol supports communications over a standard serial
port, such as COM1
in Windows. .
It is identified by using serial
as the protocol
name in a URI.
The hostname in the URI is ignored. However, to have a properly formed URI the hostname must be specified. It is best to specify the "remote" host or device with which communications is being performed as a reminder of what is connected to the serial port.
The port in the URI determines the serial port used for communications. In Windows,
the port number is appended to the string "COM" to form the name of the port. For
example, the URI serial://gps-sensor:2 refers to a GPS
sensor connected to COM2
.
When communicating between two different targets via the serial port, be aware that timers on the two targets may differ ever so slightly due to crystal oscillator or operating system discrepancies. To ensure reliable communications, it may be necessary to ensure the receiving system is operating at a slightly higher sampling period than the transmitter.
Limitations
Performance
Note that the number of bytes per second that may be transferred over a serial connection is generally less than 1/10 of the baud rate. For example, transfer rates of more than 5.7 kB/sec should not be expected from a 57600 baud connection. Furthermore, the data type being transmitted must also be taken into account. Since a double value is 8 bytes, no more than 720 doubles/sec may be transferred using a 57600 baud connection. For a 1KHz sampling time, that's less than one double value per sampling instant!
Multiple client connections
The serial protocol will only accept a single client connection at a time on a given port. It does not support time-division multiplexing of multiple client connections over a single serial port because doing so would require adding a header to the information packets sent over the port. RCP communication protocols never add extra information to the data sent over the communication channel in order to allow RCP to communicate with user applications, sensors and other devices which would not support RCP-specific data packets.
Options
baud
75 | 150 | 1200 | 4800 | 14400 | 57600 | 230400 |
110 | 300 | 1800 | 7200 | 19200 | 115200 | 960800 |
134 | 600 | 2400 | 9600 | 38400 | 128000 | 921600 |
word
stop
parity
none
,
even
, odd
, mark
and space
are
supported. The first letter may also be used as an abbreviation. The default
parity value is none
.
flow
none
, hardware
and software
.
The abbreviations hw
and sw
may be used instead.
The default flow control is none
.
memsize
sndsize
rcvsize
device
Driver
The driver supporting serial communications is called qrt_serial
.
Targets
Target |
Supported |
Comments |
---|---|---|
Yes |
Fully supported. |
See Also
Copyright © Quanser Inc. This page was generated 2021-09-24. Submit feedback to Quanser about this page.
Link to this page.