User`s manual

Watlow Controls Communications Guide 7
Serial Communication ASCII Control Codes
The interfaces we’ve chosen employ serial
communication, which is the exchange of
data in a one-bit-at-a-time, sequential
manner on a single data line or channel.
Serial contrasts with parallel
communication, which sends several bits
of information simultaneously over multiple
lines or channels. Not only is serial data
communication simpler than parallel, it is
also less costly
ASCII Control Codes are used to give
instructions to the remote device and
result in specific actions, such as a line
feed instruction on a printer.
ASCII
Char
Dec Hex Ctrl Key
Equiv.
Definition ASCII
Char
Dec Hex Ctrl Key
Equiv.
Definition
NUL 00 00 Crtl @ Null Character DC1 17 11 Crtl Q Data Control 1 - XON
SOH 01 01 Crtl A Start of Header DC2 18 12 Crtl R Data Control 2
STX 02 02 Crtl B Start of Text DC3 19 13 Crtl S Data Control 3 - XOFF
ETX 03 03 Crtl C End of Text DC4 20 14 Crtl T Data Control 4
EOT 04 04 Crtl D End of Transmission NAK 21 15 Crtl U Negative Acknowledge
ENQ 05 05 Crtl E Enquiry SYN 22 16 Crtl V Synchronous Idle
ACK 06 06 Crtl F Acknowledge ETB 23 17 Crtl W End of Trans Block
BEL 07 07 Crtl G Bell CAN 24 18 Crtl X Cancel
BS 08 08 Crtl H Back Space EM 25 19 Crtl Y End of Medium
HT 09 09 Crtl I Horizontal Tabulation SUB 26 1A Crtl Z Substitute
LF 10 0A Crtl J Line Feed ESC 27 1B Crtl [ Escape
VT 11 0B Crtl K Vertical Tabulation FS 28 1C Crtl \ File Separator
FF 12 0C Crtl L Form Feed GS 29 1D Crtl ] Group Separator
CR 13 0D Crtl M Carriage Return RS 30 1E Crtl | Record Separator
SO 14 0E Crtl N Shift Out US 31 1F Crtl _ Unit Separator
SI 15 0F Crtl O Shift In SP 32 20 Space
DLE 16 10 Crtl P Data Link Escape
Parity Bit
Remember that ASCII is a seven- or eight-
bit code. What about that eighth bit? It’s
called the parity bit. A parity bit is added
to the ASCII character to verify the
accuracy of the first seven bits. We are
declaring that the number of 1s in the 8-
bit character frame will be either always
odd or always even.
This way we can detect a single error in
the seven-bit group. Take a look at the
representation of the transmitted upper
case “W.” In this case we have selected
“odd” parity. The number of 1s in the
first seven bits, plus the parity bit, must
always total an odd number. The total
number of 1s in the binary character
1010111 (W) is 5, already an odd number.
Thus our parity bit will be a 0.
If we were transmitting the lower case “w”
(binary 1110111), the parity bit would be
a 1 because the total number of 1’s in the
character frame is 6, an even number.
Adding the parity bit makes it odd, and
consistent with the odd parity rule.
If a noise spike came onto the data line and
changed the signal voltage level enough to
reverse a 1 to a 0 in the character frame, the
receiver would detect that error. The total
number of 1s would be even and a violation of
the odd-parity rule.
At Watlow, we use odd, even and no parity.
Odd parity sets the parity bit to 0 if there are an
odd number of 1s in the first seven bitsEven
parity sets the parity bit to 0 if there are an even
number of 1s in the first seven bits.
No parity ignores the parity bit.
ASCII Control Codes, the first 33
ASCII characters (non printable), are
important for the operation of
communicating equipment. They give
instruction to remote devices that
result in specific actions such as a
line feed on a printer Holding down
the keyboard control key while
pressing the appropriate keyboard
key will send these values.