Flow Control is a way of throttling the rate at which data is received.
Under normal conditions the input buffer of a device can hold enough characters to allow buffering while the system is too busy to process the data that's already in.
But sometimes
Flow Control is a way of throttling the rate at which data is received.
Under normal conditions the input buffer of a device can hold enough characters to allow buffering while the system is too busy to process the data that's already in.
But sometimes data comes in faster than the processor can handle at that time.
Under such circumstances we may get a buffer overflow, data is lost, and communication fails.
Flow Control can help prevent buffer overflows by signalling the transmitter to pause the transmission, allowing the receiver to empty its buffer before continuing again.
The SB-Bus can work with two types of Flow Control. You can select the desired mode with the *FLOW system command.
In communication jargon this is often called software flow control, because it is entirely handled by a software protocol. It is not an SB-Bus specific property, because all terminal emulation programs support it, which makes implementation of the protocol very simple.
When the receive buffer of a device threatens to overflow it will send a special Ctrl Character to the other communication partner, telling it to stop transmitting immediately.
Transmission may only commence when the receiving party sends another special Ctrl Character.
Generally speaking the receiver sends the XOFF (transmit off) character to instruct the other side to stop transmitting. And it will send XON (transmit on) as soon as the input buffer can accept a reasonable amount of new characters again.
|Ctrl-Q||$11||Flow Control XON character.
This Character is usually used to resume transmission, when it was paused by an XOFF character.
A Slave will always use the XON character to signal the Master that it can resume transmissions. On the other hand, the Slave can accept any character other than ESC to resume its transmissions. ESC will cancel all transmissions, even when they were paused.
The resume character (XON or any other character) should be ignored as data.
|Ctrl-S||$13||Flow Control XOFF character. This character can be used to pause the transmission from the other side, when the receiver can't keep up with the flow of data it receives. Both Master and Slave devices can send the XOFF character when their input buffer threatens to overflow. The other side is then supposed to pause the transmission until further notice. The device that sent the XOFF character should send a XON character (Ctrl-Q) as soon as its input buffer can accept new characters again.|
Under normal circumstances it will not be necessary to pause transmissions because the input buffer of a Slave is usually large enough to hold an entire command. Flow Control is only needed when a Master keeps flooding the Slave with commands without waiting for the Slave's prompts, or during the transfer of large amounts of data.
A newly selected Slave is always in the XON state because its input buffer is always empty.
The XON/XOFF Flow Control is always active, even when the additional Acknowledge Flow Control is selected. By default Acknowledge Flow Control is disabled after a device reset.
Acknowledge Flow Control is an addition to the standard XON/XOFF Flow Control, and is only meant for the transfer of multiple lines of data.
The general principle is to send an acknowledge character after receiving each line of data.
No new lines are sent until the acknowledge is received.
This ensures that the receiving party has received, accepted and processed the received line before the next one is sent.
After a device reset the Acknowledge Flow Control is disabled in which case the device will only use XON/XOFF Flow Control. You can switch the Acknowledge Flow Control on or off with the system command *FLOW.
Please