The text of a manual · part 5 of 31
DF1 Protocol and Command Set Reference Manual: 2 - Understanding DF1 Protocol
Pages 30 to 37 of 251, from DF1 Protocol and Command Set Reference Manual
The original document is the PDF (2.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Allen-Bradley 5250-LP and Allen-Bradley 5250-MLP1
Page 30
Chapter
2
Understanding DF1 Protocol If you are connecting an interface module to a computer, you must program the computer to understand and issue the proper protocol character sequences. This chapter describes the DF1 protocol you can use with your DF1-link driver for: • peer-to-peer (two-way simultaneous) communication • master-slave (two-way alternate) communication This chapter includes these sections: Section
Page
DF1 Protocol
2-2
Character Transmission
2-5
Transmission Symbols
2-6
Important:
The 1784-KT and 1784-KT2 cards connect directly to DH+; the 1784-KR card connects directly to DH-485. As a result, an asynchronous RS-232 interface is not used and the information in this chapter does not apply to software written for these cards, which use the Standard Driver software.
Publication 1770-6.5.16 - October 1996
Page 31
2–2
Understanding DF1 Protocol
DF1 Protocol
A link protocol is a set of programming rules for interpreting the signals transmitted over a physical link. A protocol, such as DF1: • carries a message, error free, from one end of the link to the other It has no concern for the content of the message, the function of the message, or the ultimate purpose of the message. For example, with full-duplex DF1 protocol, it accomplishes this by attaching a check character (BCC) or check characters (CRC) to the end of each command and reply. The device receiving the command or reply then verifies the BCC or CRC and returns an ACK - if the BCC or CRC is acceptable - or an NAK - if the BCC or CRC does not check. • indicates failure with an error code Internally, the link protocol must delimit messages, detect and signal errors, retry after errors, and control message flow. DF1 protocol is an Allen-Bradley data-link layer protocol that combines features of subcategories D1 (data transparency) and F1 (two-way simultaneous transmission with embedded responses) of ANSI x3.28 specification. There are two categories of DF1 protocol: • half-duplex protocol (master-slave communication) • full-duplex protocol (peer-to-peer communication)
Half-duplex Protocol Half-duplex protocol is a multidrop protocol for one master and one or more slaves. With half-duplex protocol, you can have 2 to 255 nodes simultaneously connected on a single link; this link operates with all nodes interfaced through half-duplex modems. (For a list of devices that can be used as masters and slaves, see page 3–2. For more on half-duplex protocol, refer to Chapter 3, “Using Half-duplex Protocol to Send and Receive Messages.”) To implement half-duplex protocol, use the following communication characteristics: • 8 bits per character • no parity • 1 stop bit
Publication 1770-6.5.16 - October 1996
Page 32
Understanding DF1 Protocol
"
2–3
Using half-duplex protocol When you use half-duplex protocol, the intended environment is a multidrop link with all nodes interfaced through half-duplex modems. Unless there is only one slave directly connected to a master, you must use a modem. Your modems must support these signals: • request-to-send (RTS) • clear-to-send (CTS) • data-carrier-detect (DCD) • data-set-ready (DSR) • data-terminal-ready (DTR) If your modem does not support the DCD and DSR signals, you must jumper DCD and DSR to DTR.
You designate one node as master to control which node has access to the link. All other nodes are slaves, and must wait for permission from the master before transmitting. Each slave node has a unique node number between 0 and 254 (decimal). The master can send and receive messages to and from each node on the multidrop link and to and from every node on network links connected to the multidrop link. If the master is programmed to relay messages, then nodes on the multidrop link can engage in virtual slave-to-slave communication. This communication is transparent to the application. Multiple masters are not allowed, except when one acts as a backup to the other and does not communicate unless the primary is shut down.
"
Slave-to-slave communication In slave-to-slave communication, the master looks at the packet received from the slave. If the packet is not for the master, the master reassembles the packet as a master packet and sends the packet to slave devices.
Publication 1770-6.5.16 - October 1996
Page 33
2–4
Understanding DF1 Protocol
Full-duplex Protocol Use full-duplex protocol: • over a point-to-point link that allows two-way simultaneous transmission • over a multidrop link where interface modules are able to arbitrate transmission on the link • for high performance applications where it is necessary to get the highest possible throughput from the available medium If you connect an interface module to another Allen-Bradley communication interface module, the modules automatically handle the link arbitration. (For a list of modules that automatically handle link arbitration, refer to page 4–1.)
"
Full-duplex dial-up modems Full-duplex dial-up modems can be used as long as a carrier is detected before the carrier timeout (about 10 seconds). If a carrier is not sensed before the timeout, the module drops DTR to trigger the modem to hang up the phone. A carrier must be sensed at least every 10 seconds to maintain the connection.
Publication 1770-6.5.16 - October 1996
Page 34
Understanding DF1 Protocol
Character Transmission
2–5
Allen-Bradley interface modules send data serially over the RS-232-C/RS-422-A interface, one 10-bit byte - 11-bit byte with parity - at a time. The transmission format conforms to ANSI X3.16, CCITT V.4, and ISO 1177 standards, with the exception that the parity bit is retained while the data length is extended to eight bits. Make sure that your computer conforms to this mode of transmission. The transmission format is: No Parity start bit data bit 0 data bit 1 data bit 2 data bit 3 data bit 4 data bit 5 data bit 6 data bit 7 one stop bit With Parity start bit data bit 0 data bit 1 data bit 2 data bit 3 data bit 4 data bit 5 data bit 6 data bit 7 even parity bit one stop bit
For all DH, DH+, and DH485 interface modules, you must comply with this transmission format. For communication rates and parity settings, refer to your module’s user manual.
Publication 1770-6.5.16 - October 1996
Page 35
2–6
Understanding DF1 Protocol
Transmission Symbols
Both half-duplex and full-duplex protocols are character-oriented. They use the ASCII control characters in the tables below, extended to eight bits by adding a zero for bit 7: Table 2.A Half-duplex Protocol Abbreviation
Hexadecimal Value
Binary Value
STX
02
0000 0010
SOH
01
0000 0001
ETX
03
0000 0011
EOT
04
0000 0100
ENQ
05
0000 0101
ACK
06
0000 0110
DLE
10
0001 0000
NAK
0F
0000 1111
Table 2.B Full-duplex Protocol Abbreviation
Hexadecimal Value
Binary Value
STX
02
0000 0010
ETX
03
0000 0011
ENQ
05
0000 0101
ACK
06
0000 0110
DLE
10
0001 0000
NAK
0F
0000 1111
(For the standard definition of these characters, refer to the ANSI X3.4, CCITT V.3, and ISO 646 standards.) A symbol is a sequence of one or more bytes having a specific meaning to the link protocol. The component characters of a symbol must be sent one after another with no other characters between them. DF1 protocol combines the characters listed in the tables above into control and data symbols: • Control symbols are fixed symbols required by the DF1 protocol to read a particular message • Data symbols are variable symbols which contain the application data for a particular message
Publication 1770-6.5.16 - October 1996
Page 36
Understanding DF1 Protocol
2–7
Table 2.C Half-duplex Transmission Symbols Symbol
Type
Meaning
DLE SOH control symbol
Sender symbol that indicates the start of a master message.
DLE STX control symbol
Sender symbol that separates the multi-drop header from the data.
DLE ETX BCC/CRC control symbol
Sender symbol that terminates a message.
DLE ACK control symbol
Response symbol which signals that a message has been successfully received.
DLE NAK control symbol
Global link reset command only issued by the master. Causes the slaves to cancel all messages that are ready to transmit to the master. Typically, the slave returns the message and an error code to the originator.
DLE ENQ control symbol
Sender symbol, issued only by the master, that starts a poll command.
DLE EOT BCC control symbol
Response symbol used by slaves as a response to a poll when they have no messages to send.
STN data symbol
Station number of the slave node on your half-duplex link.
APP DATA data symbol
Single characters having values 00-0F and 11-FF. Includes data from application layer including user programs and common application routines. A data 1016 is sent as 10 10 (DLE DLE).
DLE DLE data symbol
Represents the data value or STN value of 1016. See APP DATA.
Publication 1770-6.5.16 - October 1996
Page 37
2–8
Understanding DF1 Protocol
Table 2.D Full-duplex Transmission Symbols
Publication 1770-6.5.16 - October 1996
Symbol
Type
Meaning
DLE STX control symbol
Sender symbol that indicates the start of a message frame.
DLE ETX BCC/CRC control symbol
Sender symbol that terminates a message frame.
DLE ACK control symbol
Response symbol which signals that a message frame has been successfully received.
DLE NAK control symbol
Response symbol which signals that a message frame was not received successfully.
DLE ENQ control symbol
Sender symbol that requests retransmission of a response symbol from the receiver.
APP DATA data symbol
Single character data values between 00-0F and 11-FF. Includes data from application layer including user programs and common application routines. A data 1016 is sent as 10 10 (DLE DLE).
DLE DLE data symbol
Represents the data value of 1016.