![]() |
| Home |
|
|
ProtocolsBy default, RTCom uses no protocol to prevent overflow errors. In this mode, it is assumed that all communication participants are ready to accept data. If a receive buffer of RTCom overflows, the error COM_BUFFER_FULL is reported. In interrupt-driven mode, RTCom also supports protocols XOn/XOff, RTS/CTS, and DTR/DSR. These protocols can prevent buffer overflows. A receiver checks after each byte received whether the receive buffer has filled up to a dangerous level. If so, the sender is informed to stop sending. As soon as the receive buffer has been emptied to a safe level, the sender is allowed to continue sending. The XOn/XOff protocol uses special ASCII control characters to send the necessary information to the sender. It can only be used if the actual data stream never contains XOn/XOff characters. Protocols RTS/CTS and DTR/DSR use handshake lines. However, they require that the corresponding lines are actually connected in the cable used. RTCom supports these protocols in Passive and Active modes. In Passive mode, RTCom will understand and adhere to XOn/XOff characters or CTS or DSR signals, respectively. In this way, a buffer overflow error can be prevented on the remote device. The local receive buffer can still overflow if the receiving task does not collect the data fast enough. In Active mode, RTCom will also protect its own receive buffer. If a buffer fills to more than 70% of its size, an XOff is sent to the remote device (or signal RTS or DTR is reset). In this case, the remote device should stop sending. A protocol task in RTCom will then periodically check whether the buffer is filled to less than 30% of its size. If so, the remote device is allowed to continue sending (by sending an XOn to it, or by setting the RTS or DTR signal).
|