<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rs-485.com/index.php?action=history&amp;feed=atom&amp;title=Software_flow_control</id>
	<title>Software flow control - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rs-485.com/index.php?action=history&amp;feed=atom&amp;title=Software_flow_control"/>
	<link rel="alternate" type="text/html" href="https://rs-485.com/index.php?title=Software_flow_control&amp;action=history"/>
	<updated>2026-05-04T09:01:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://rs-485.com/index.php?title=Software_flow_control&amp;diff=1444&amp;oldid=prev</id>
		<title>RS-485: Imported from Wikipedia (overwrite)</title>
		<link rel="alternate" type="text/html" href="https://rs-485.com/index.php?title=Software_flow_control&amp;diff=1444&amp;oldid=prev"/>
		<updated>2026-05-03T12:41:48Z</updated>

		<summary type="html">&lt;p&gt;Imported from Wikipedia (overwrite)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Flow control method}}&lt;br /&gt;
{{Redirect-distinguish|Xon|Xon (character)|XON (company)}}&lt;br /&gt;
{{refimprove|date=March 2009}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Software flow control&amp;#039;&amp;#039;&amp;#039; is a method of [[flow control (data)|flow control]] used in computer [[data link]]s, especially [[RS-232|RS-232 serial]].  It uses special codes, transmitted [[in-band signaling|in-band]], over the primary communications channel.  These codes are generally called &amp;#039;&amp;#039;&amp;#039;XOFF&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;XON&amp;#039;&amp;#039;&amp;#039; (from &amp;quot;transmit off&amp;quot; and &amp;quot;transmit on&amp;quot;, respectively).  Thus, &amp;quot;software flow control&amp;quot; is sometimes called &amp;quot;XON/XOFF flow control&amp;quot;.  This is in contrast to flow control via dedicated [[Out-of-band data|out-of-band]] signals — &amp;quot;[[Flow control (data)#Hardware flow control|hardware flow control]]&amp;quot; — such as [[RS-232 RTS/CTS]].&lt;br /&gt;
&lt;br /&gt;
== Representation ==&lt;br /&gt;
&lt;br /&gt;
For systems using the [[ASCII]] character code, XOFF is generally represented using a [[character (computing)|character]] or [[byte]] with decimal value 19; XON with value 17.&lt;br /&gt;
&lt;br /&gt;
The ASCII standard does not reserve any [[control character]]s for use as XON/XOFF specifically.  However, it does provide four generic &amp;quot;device control&amp;quot; characters (DC1 through DC4).  The [[Teletype Model 33]] ASR adopted two of these, DC3 and DC1, for use as XOFF and XON, respectively.  This usage was copied by others, and is now a [[de facto standard]].  The keyboard equivalents of {{key press|Ctrl|S}} for XOFF, and {{key press|Ctrl|Q}} for XON, also derive from this usage.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ XOFF/XON representations in ASCII&lt;br /&gt;
! Code&lt;br /&gt;
! Meaning&lt;br /&gt;
! [[ASCII]]&lt;br /&gt;
! [[Decimal|Dec]]&lt;br /&gt;
! [[Hexadecimal|Hex]]&lt;br /&gt;
! Keyboard&lt;br /&gt;
|-&lt;br /&gt;
| XOFF&lt;br /&gt;
| Pause transmission&lt;br /&gt;
| DC3&lt;br /&gt;
| 19&lt;br /&gt;
| 13&lt;br /&gt;
| {{key press|Ctrl|S}}&lt;br /&gt;
|-&lt;br /&gt;
| XON&lt;br /&gt;
| Resume transmission&lt;br /&gt;
| DC1&lt;br /&gt;
| 17&lt;br /&gt;
| 11&lt;br /&gt;
| {{key press|Ctrl|Q}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mechanism ==&lt;br /&gt;
&lt;br /&gt;
When one end of a data link is unable to accept any more data (or approaching that point), it sends XOFF to the other end.  The other end receives the XOFF code, and suspends [[transmission (telecommunications)|transmission]].  Once the first end is ready to accept data again, it sends XON, and the other end resumes transmission.&lt;br /&gt;
&lt;br /&gt;
For example, one may imagine a [[computer]] sending data to a slow [[printer (computing)|printer]]. Since the computer is faster at sending data than the printer can print it, the printer falls behind and approaches a situation where it would be overwhelmed by the data.  The printer reacts to this situation by sending XOFF to the computer, which temporarily stops sending data.  When the printer is again ready to receive more data, it sends XON to the computer, which starts sending data again.&lt;br /&gt;
&lt;br /&gt;
XOFF/XON can be employed in both directions, for example, two [[teleprinter]]s connected to each other.&lt;br /&gt;
&lt;br /&gt;
== Comparison with hardware flow control ==&lt;br /&gt;
&lt;br /&gt;
The principal advantage of software flow control is the reduction in the number of [[electrical conductor]]s between sender and receiver.  Given a [[ground (electricity)|common ground]], only two signals are needed, one to send and the other to receive.  Hardware flow control requires additional wires between the two devices.  It also requires specific hardware implementation, which had more significant costs in earlier days of computing (i.e., 1960s and 70s).&lt;br /&gt;
&lt;br /&gt;
However, software flow control is not without its problems. The most important drawback is that software flow control is less reliable. Sending XOFF requires at least one character time to transmit, and may be queued behind already-transmitted data still in buffers.  Hardware signals may be asserted almost instantaneously, and out-of-order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;|&lt;br /&gt;
|+ Summary of flow control tradeoffs&lt;br /&gt;
! {{tooltip|2=Flow control method|Type}}&lt;br /&gt;
! {{tooltip|2=Prevents loss of data due to buffer overruns|Data integrity}}&lt;br /&gt;
! {{tooltip|2=Does not require additional wiring and electronics|Low cost}}&lt;br /&gt;
! {{tooltip|2=All bytes can be transmitted without using escape mechanisms|Out of Band}}&lt;br /&gt;
|-&lt;br /&gt;
| Hardware flow control&lt;br /&gt;
| Most reliable&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
| On-chip software f.c.&lt;br /&gt;
| Good&lt;br /&gt;
| {{Some}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|-&lt;br /&gt;
| Software f.c. (FIFO disabled)  &lt;br /&gt;
| Good, but slow&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|-&lt;br /&gt;
| Software f.c. (FIFO enabled)&lt;br /&gt;
| Unreliable&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As the name &amp;quot;software flow control&amp;quot; implies, flow control using this method is &amp;#039;&amp;#039;usually&amp;#039;&amp;#039; implemented in software (or [[firmware]]), which can cause further delays in XOFF response. These delays can lead to data corruption due to [[buffer overruns]]. Hardware flow control, on the other hand, is typically under the direct control of the transmitting [[Universal asynchronous receiver/transmitter|UART]], which is able to cease transmission immediately, without the intervention of higher levels. To handle the latency caused by builtin [[FIFO (computing and electronics)|FIFOs]], more advanced UARTs, like the 16950, provide &amp;quot;on-chip&amp;quot; software flow control.&amp;lt;ref name=&amp;quot;moxa&amp;quot;&amp;gt;{{Cite book |last=Yang |first=Casper |url=https://moxa.com.cn/getmedia/2489d383-e47d-4258-94ba-9075fbeb618f/moxa-the-secrets-of-uart-fifo-tech-note-v1.0.pdf |title=The Secrets of Flow Control in Serial Communication |publisher=Moxa Technical Writing Center |year=2009 |edition=1.0 |series=Moxa Tech Note |publication-date=September 30, 2009 |language=EN |access-date=Aug 4, 2022 |archive-url=https://web.archive.org/web/20220804214055/https://moxa.com.cn/getmedia/2489d383-e47d-4258-94ba-9075fbeb618f/moxa-the-secrets-of-uart-fifo-tech-note-v1.0.pdf |archive-date=Aug 4, 2022}}&amp;lt;/ref&amp;gt; UARTs that lack such support, like the [[16550 UART|16550]], may suffer from buffer overruns when using software flow control, although this can be somewhat mitigated by disabling the UART&amp;#039;s FIFO.&amp;lt;ref name=&amp;quot;moxa&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, since the XOFF/XON codes are sent in-band, they cannot appear in the data being transmitted without being mistaken for flow control commands.  Any data containing the XOFF/XON codes thus must be encoded in some manner for proper transmission, with corresponding overhead.  This is frequently done with some kind of [[escape sequence]].  For printing devices that directly interpret ASCII codes, this is not a large problem, because the XON and XOFF codes use [[ASCII]] &amp;quot;device control&amp;quot; code numbers.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
Software flow control is used extensively by low-speed devices, especially older [[printer (computing)|printer]]s and [[dumb terminal]]s, to indicate they are temporarily unable to accept more data.  Typically, this is due to a combination of limited [[Output (computing)|output]] rate and any [[Data buffer|buffers]] being full.  Some terminal control packages, such as [[termcap]], employ &amp;quot;padding&amp;quot; (short delays using millisecond granularity&amp;lt;ref&amp;gt;{{cite web|url=https://www.gnu.org/software/termutils/manual/termcap-1.3/html_node/termcap_10.html|title=The Termcap Library - Describe Padding|website=www.gnu.org}}&amp;lt;/ref&amp;gt;) to allow such equipment sufficient time to perform the requested actions without the need to assert XOFF.&lt;br /&gt;
&lt;br /&gt;
XOFF/XON are still sometimes used manually by computer operators, to pause and restart output which otherwise would [[scrolling|scroll]] off the display too quickly.&lt;br /&gt;
&lt;br /&gt;
[[Terminal emulator]] software generally implements XOFF/XON support as a basic function.  This generally includes the [[system console]] on modern [[Unix]] and [[Linux]] machines, as well as [[graphical user interface|GUI]] emulators such as [[xterm]] and the [[Win32 console]].&lt;br /&gt;
&lt;br /&gt;
Robust XON is a technique to restart communication, just in case it was stopped by an accidentally received XOFF.  The receiving unit sends periodic XON characters when it can receive data, and the line is idle.  One common use is by serial printers (like [[HP LaserJet]] II) to indicate they are online and ready to receive data. The XON is sent every 1 to 30 seconds depending on the printer&amp;#039;s firmware design.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Ethernet flow control]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
* {{cite web |url=http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl06142&amp;amp;locale=en_US |title=HP LaserJet IIP and IIP Plus Printers - Control Panel Keys and Menus |publisher=[[Hewlett-Packard]] |archiveurl=https://web.archive.org/web/20060509012616/http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl06142&amp;amp;amp;locale=en_US |archivedate=May 9, 2006}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Flow control (data)]]&lt;/div&gt;</summary>
		<author><name>RS-485</name></author>
	</entry>
</feed>