The text of a manual · part 4 of 31
DF1 Protocol and Command Set Reference Manual: 1 - Network Layers
Pages 18 to 29 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 18
Chapter
1
Network Layers Your network is made up of several layers, including:
Nodes send data through the layers.
Application layer serves as the window through which applications access communication services, including file transfers, virtual terminal functions, and email. Presentation layer manages data formats for the applications. Session layer establishes and terminates network communications between applications. Transport layer performs segmentation and re-assembly of messages. Provides recovery from transmission errors. Network layer establishes connections for communication between network nodes. Data-link layer runs protocol to guard against errors, detects errors, and corrects errors. Packages data and puts it onto the physical cable. Manages the flow of the data bit stream into and out of each network node. Physical layer transmits bits between communication devices.
In this chapter, we discuss the physical, data-link, and application layers. (We refer to the data-link and application layers as the software layers.) This chapter contains these sections: Section
Page
Physical Layer
1-2
Software Layers
1-7
Message Packet Structure
1-9
Publication 1770-6.5.16 - October 1996
Page 19
1–2
Network Layers
Physical Layer
The physical layer is a set of cables and interface modules that provides a channel for communication between the nodes. A node is a connection point onto a network, typically containing a unique address.
IBM-PC XT, AT or compatible computer
DF1 link RS-232 Network Interface network link DH/DH+/DH485 link nodes
ControlNet link
When you connect a computer serially to your DH, DH+, DH-485, or ControlNet link, the interface module acts as an interface between the: • DF1 link (RS-232 or RS-422-A) • network link (DH, DH+, DH485, ControlNet link)
DF1 Link A DF1 link provides: • master-slave communication through a half-duplex protocol • peer-to-peer communication through a full-duplex protocol This manual provides information necessary to write your own driver for an intelligent device on a DF1 link. See “Software Layers,” on page 1–7, for the layers your software driver must implement so that your intelligent device can talk to other DH, DH+, DH485, or ControlNet nodes.
Network Link These network links are available for peer-to-peer communication: This link
Connects
And allows
See page
DH
•PLC-2, PLC-3 processors •color graphic systems •personal computers •host computers •programmable RS232/RS-422 devices up to 64 nodes➀
1-3 up to 64 nodes
1-5 up to 32 nodes
1-6 up to 99 nodes
--------
DH+ DH485
ControlNet ➀
Publication 1770-6.5.16 - October 1996
•same devices as DH •PLC-5 processors •SLC 5/04 processor •SLC 500 processors •color graphic systems •personal computers •PLC-5 processors •I/O devices •personal computers •operator interface devices
Using bridges (e.g., 1785-KA modules), you can extend the length of your DH network to contain up to 255 nodes.
Page 20
Network Layers
1–3
DH Link A DH link is a local area network (LAN) designed for factory-floor applications. This link accepts 64 devices and can transmit 57.6 K bits of data per second. A DH link consists of a trunk cable up to 10,000 feet (3,048 meters) long and drop cables as long as 100 feet (30.48 meters) each. Each node is at the end of a drop cable and connects to the DH link through a station connector (cat. no. 1770-SC). This is the only configuration tested and supported by Allen-Bradley. This processor
Connects to a DH link through the
PLC-2 family
DH PLC-2 family communication adapter module (cat. nos. 1771-KA2, -KG)
PLC-3
DH PLC-3 family communication adapter module (cat. nos. 1775-KA,-S5, -SR5)
PLC-5/250
Resource manager module (cat. nos. 5130--KA, -RM1,-RM2)
PLC-5, SLC 5/04➀
DH+/DH communication module (cat. no. 1785-KA)
➀
Although a PLC-5 processor does not directly connect to a DH link, it can communicate with devices on a DH link via the 1785-KA module.
A DH link implements peer-to-peer communication through a scheme called the floating master. With this arrangement, each node has equal access to become the master. The nodes bid for temporary mastership based on their need to send information.
Publication 1770-6.5.16 - October 1996
Page 21
1–4
Network Layers
Unlike a master/slave relationship, a floating master relationship does not require the current master to poll each node to grant permission to transmit. Therefore, it provides a more efficient network because there is less overhead - i.e., time - per transaction. PLC-2/30 processor personal computer
SC
= station connector; 1770-SC 1771-KG modem modem PLC-3 processor cat. nos. 1775-KA or -S5
SC
PLC-5/250 processor 5130-RM1
RS-232-C link (50 cable-ft. max.)
modem modem
DH interface module cat. nos. 1771-KE, -KF
SC
SC
SC
DH link
1770-KF2 SC
SC
SC 1770-KF2 RS-232-C link (50 cable-ft. max.)
1785-KA DH+ link
PLC-2 family processor cat. no. 1771-KA2 T60 industrial workstation running ControlView software
Publication 1770-6.5.16 - October 1996
Page 22
Network Layers
1–5
DH+ Link A DH+ link is similar to a DH link, but is optimally used for smaller networks consisting of limited nodes (about 15 maximum). A DH+ link accepts 64 devices and can transmit data at 57.6, 115.2, or 230.4K bits. (PLC-5/250, SLC, and PLC processors support 57.6 and 115.2K bits; SLC 5/04 processors support 230.4K bits; PLC-5 processors are expected to support 230.4K bits early in 1997.) This processor
Connects to a DH+ link
PLC-2 through the PLC-2 Family Interface module (cat. no. 1785-KA3)
PLC-3 through the I/O Scanner Communication Adapter module (cat. nos. 1775-S5,-SR5)
PLC-5 directly
PLC-5/250 through the Resource Manager module (cat. nos. 5130-KA, -RM1, -RM2)
SLC 5/04➀ directly
➀
You can configure the data rate for SLC 5/04 processors.
A DH+ link implements peer-to-peer communication with a token-passing scheme to rotate link mastership among the nodes connected to that link. SC
= station connector; 1770-SC personal computer
T71 with 1784-KTx
PLC-5 processor
PLC-3 processor cat. no. 1775-S5
PLC-5/250 processor cat. no. 5130-RM1 notebook computer with 1784-PCMK
1785-KE
SC
DH+ link
SC
1770-KF2
SLC 5/04 processor
RS-232-C link (50 cable-ft. max.) 1785-KA SC DH link
T53 programming terminal with 1784-KT PLC-2 processor cat. no. 1785-KA3 installed (or any other PLC-2 processor)
T60 industrial workstation with ControlView software
Publication 1770-6.5.16 - October 1996
Page 23
1–6
Network Layers
DH485 Link A DH485 link is a low cost, peer-to-peer programming and data-acquisition link for a variety of Allen-Bradley products. DH485 topology is similar to DH and DH+ topology. You can connect as many as 32 nodes to a DH485 link. The DH485 link is based on the Electrical Industries Association (EIA) Standard RS-485 Electrical Signalling Specification. A variety of Allen-Bradley products (including SLC 500 controllers, 1784-KTX, 1747-KE, 1770-KF3, and operator interface devices) act as token-passing masters on the DH485 link. This link also supports a respond-only mode for low-level devices on the link, such as Allen-Bradley bar code decoders. A DH485 link implements peer-to-peer communication with a token-passing scheme to rotate link mastership among the nodes connected to that link. T53 programming terminal with a 1784-KTX card installed and running 6200 series software
PLC-5 processor
DH+ link
1747-AIC SLC 5/04 channel 1 processor
1747-AIC
1747-AIC
SLC 500 fixed 30-I/O controller with expansion chassis notebook compute with 1784-PCMK
RS-232/RS-485 converter 1747-PICÀ SLC 5/01 processor in 17-slot modular system channel 0
DH485 link 1747-SN SLC 5/03 processor
PanelView 550 operator terminal DTAM Plus operator interface
1747-AIC
1770-KF3 1747-AIC remote I/O link ÀTo connect an SLC 5/04 to a 1747-PIC, use a 9-pin (male) to 25-pin (female) adapter.
Publication 1770-6.5.16 - October 1996 to remote I/O chassis
Page 24
Network Layers
Software Layers
1–7
Your DF1 links and network links (DH, DH+, and DH485) each use two layers of software to enable communication: • the data-link layer • the application layer This figure shows how these layers fit together. DH/DH+/DH485 RS-232 interface modules computer
PLC processor application application common application routines common application routines RS-232 data link layer
RS-232 link layer (DF1)
link layer (network)
DH/DH+ DH485
DH/DH+ /DH485 data link layer
Data-link Layer This layer controls the flow of communication over the physical link and: • determines the encoding of data on the physical medium • controls who transmits data and who listens using an arbitration protocol • conveys data packets intact from the source node to the destination node over the physical link
"
If your link is
Then a DH, DH+ or DH485 link you do not need to program this layer. Your application programs on the network are not involved with inter-node protocol, handshaking, or control of the link.
a DF1 link between Allen-Bradley interface modules the interface modules automatically take care of this layer. Your application program does not have to be involved with handshaking control.
a DF1 link between an Allen-Bradley interface module and a computer you must program this layer at your computer.
Programming the data-link layer You can program the data link layer using DF1 protocol. For more information, see Chapter 3, “Using Half-duplex Protocol to Send and Receive Messages,” or Chapter 4, “Using Full-duplex Protocol to Send and Receive Messages.”
Publication 1770-6.5.16 - October 1996
Page 25
1–8
Network Layers
Application Layer This layer controls and executes the actual commands specified in the communication between nodes. This layer is the same for both DF1 and network links. The application layer: • interfaces to user processes and databases • interprets commands • formats user data into packets The application layer depends upon the type of node the application is running on since it must interface to the user process and interpret the user database.
"
Processes in the application layer The application layer is typically organized into two types of processes: • senders, A sender, after receiving a signal from the user process, sends a message and awaits a reply. It then sends the results to the user process. • responders, A responder waits for an incoming message from the link. When the responder receives a message, it performs the indicated operation on the user data base and returns a reply message to the sender.
If your physical link is
Then a network link the communication modules automatically take care of this layer.
a DF1 link between Allen-Bradley interface modules the interface modules automatically take care of this layer. (See figure below.)
1747-KE
SLC 5/02 processor DH485 link RS-232 DF1 full-duplex
1785-KE
PLC-5/15 processor
DH+ link a DF1 link between an Allen-Bradley interface module and a computer
Publication 1770-6.5.16 - October 1996 you will need to program this layer at your computer.
Page 26
Network Layers
"
1–9
Messages See Chapter 7, “Communication Commands,” for: • a description of the command messages for each type of PLC processor • information on how to program the application layer fields of a message packet for an asynchronous link
Message Packet Structure
All messages on a network have the same fundamental structure, regardless of their function or destination. If you could freeze a message packet while it is in transmission, you would see: Bytes protocol data
Contents Information used by the application and data-link layers of your software to get the message to its destination: •If a transaction originates from a PLC processor, the interface module automatically fills the protocol bytes. •If the transaction originates from a computer, your computer software must supply the necessary protocol. Information supplied by application program at the source and delivered to the application program at the destination.
The following sections describe bytes that you define using the application-layer protocol bytes in your message packet. For a detailed description of how to use these bytes for each type of command, see Chapter 7, “Communication Commands.” To define this
See this page command and reply message
1-9 message priority
1-10 delivery order of commands
1-10 types of commands
1-11 error codes
1-11
Command and Reply Message A network transaction consists of a command and a reply. The two parts provide extra data integrity by making sure that a required action always returns a reply with some sort of status, either zero status for a good reply, or non-zero status as an error code. The application-layer protocol distinguishes a command from a reply. The data area of a command and its corresponding reply depend on the type of command.
Publication 1770-6.5.16 - October 1996
Page 27
1–10
Network Layers
Message Priority You specify the priority level for each DH command in the message command code. The node that receives a command message must establish the same priority level for its corresponding reply message: This link
Classifies a message as
DH high priority or normal priority Priority levels of messages determine the order in which nodes transmit messages on a DH link. In the polling process, nodes with high priority messages will always be given priority over nodes with normal priority messages.
DH+ normal priority
DH485 normal priority
Important:
Nodes with high priority messages are given priority over nodes with normal priority messages throughout the command/reply message cycle. For this reason, a command should be given a high priority designation only when special handling of specific data is required. Using an excessive number of high-priority commands defeats the purpose of this feature and could delay or inhibit the transmission of normal priority messages.
Delivery Order of Commands The sending node, the network, and the receiving node execute commands based on network conditions, including - but not limited to: • nodes buffering commands • retries due to noise on the network • priority levels If your application requires that commands be delivered in a specific order, your logic must control the initiation of one command at a time on the network and verify delivery before initiating additional commands. This verification is completed by: • a done bit or an error bit in a PLC processor • a reply message in a computer A done bit or a successful reply causes the next command to be initiated. If an error bit or a reply with non-zero status is returned, you must decide the appropriate action based on your application. Important:
Publication 1770-6.5.16 - October 1996
If any node on the network initiates multiple commands (for example, the sending node sets multiple bits at any one time), the order in which these commands get executed at the receiving node cannot be guaranteed.
Page 28
Network Layers
1–11
Types of Commands From your computer on a DF1 link to a node on a DH, DH+ or DH485 link, you can send four types of commands: • read • write • diagnostic • upload/download For additional information on the commands you can send, see Chapter 7, “Communication Commands.”
Error Codes When your computer sends a command on the asynchronous link, a status code is returned in the reply message. This code tells you the status of the command sent from your computer. You must program your computer to interpret this code. For more information on codes and their meanings, see Chapter 8, “Message Packet Status Codes.” Error codes can be generated at two places: • the sending node • the receiving node For codes that are returned from the sending node: From this node sending node receiving node
Error codes are generated when •an application program used the wrong message format or issued illegal commands. •the sending node cannot complete a transaction due to network problems. an application problem exists at the receiving node. Typically, these involve: •the PLC processor being off line (in Program mode, for example) or •the command trying to access a memory area is blocked by the interface module or user application program (i.e., the data table location does not exist or is restricted).
Publication 1770-6.5.16 - October 1996
Page 29
Protocol Understanding DF1 Protocol
Chapter 2
Using Half-duplex Protocols to Send and Receive Messages Chapter 3 Using Full-duplex Protocols to Send and Receive Messages Chapter 4