Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 6 of 31

DF1 Protocol and Command Set Reference Manual: 3 - Using Half-duplex Protocols to Send and Receive Messages, pages 38 to 46

Pages 38 to 46 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 38

Chapter

3

Using Half-duplex Protocols to Send and Receive Messages In half-duplex protocol, devices share the same data circuits, therefore only one device can “talk” at a time. Half-duplex protocol can be likened to a one-lane bridge: each car must wait its turn to cross the bridge. (To compare half-duplex to full-duplex protocol, refer to Chapter 4, “Using Full-duplex Protocols to Send and Receive Messages.”) Read this chapter to help learn how to use half-duplex protocol to send and receive messages. It contains these sections: Section

Page

Half-duplex Protocol Message Transmission

3-2

Transmitter and Receiver Message Transfer

3-3

Half-duplex Protocol Environment

3-3

Message Characteristics

3-7

Master Polling Responsibilities

3-7

Slave Transceiver Actions

3-9

Half-duplex Protocol Diagrams

3-11

Publication 1770-6.5.16 - October 1996

Page 39

3–2

Using Half-duplex Protocols to Send and Receive Messages

Half-duplex Protocol Message Half-duplex protocol: Transmission • is a multidrop protocol for one master and one or more slaves • provides a lower data throughput than full-duplex • allows communication with each node on the multidrop link • allows communication with nodes on links connected to the multidrop link If the master is programmed to relay messages, then nodes on the multidrop can engage in virtual slave-to-slave transfers. Half-duplex protocol operates on a multidrop link with all nodes interfaced through half-duplex modems. There may be from 2 to 255 nodes simultaneously connected to a single link. In half-duplex mode, one node is designated as master and it controls which node has access to the link. All other nodes are called slaves and must wait for permission from the master before transmitting. Allen-Bradley devices with master and slave capabilities include: Devices with master capability

Devices with slave capability

•SLC 5/03 and 5/04 (on channel 0)À

•1747-KE

•1771-KGM DH SCADA Master module

•1770-KF2, -KF3, -KFC

•5130-RM1, -RM2, -KA (channel 1)

•1775-KA (via modem port)

•5130-RM2

•1785-KE

•a user-programmed intelligent device

•1771-KE, -KF, -KG

•a personal computer running ControlView software •PLC-5/11 -5/20, -5/30, -5/40, -5/60, PLC-5/80 (on channel 0) •personal computer running WINtelligentt LINXt software

•PLC-5/11 -5/20, -5/30, -5/40, -5/60, PLC-5/80 (on channel 0)

•personal computer running RSLINXt

•SLC 5/03 and 5/04 (on channel 0) •5130-RM1, -RM2, -KA (channel 1) •personal computer running WINtelligentt LINXt software •personal computer running RSLINXt

À

SLC 5/03 and 5/04 processors (OS302 and OS401, respectively) now support half-duplex DF1 masters.

With half-duplex protocol, you can use a: • two-circuit system – master sends and slaves receive on one circuit, slaves send and master receives on the other • one-circuit system – master and slaves send and receive on the same circuit

Publication 1770-6.5.16 - October 1996

Page 40

Using Half-duplex Protocols to Send and Receive Messages

Transmitter and Receiver Message Transfer

3–3

Each node on a multidrop link contains a software routine to transmit and receive messages. DH and DH+ interface modules already contain a slave transceiver routine, so they can be configured to function as slave nodes in half-duplex mode. Instead of a single routine, you can program separate transmitter and receiver routines. However, in this chapter, we assume you are using a single routine. The master and slave transmitter/receivers are illustrated in the figure below: source packet OK packet sink to other slaves master transceiver

OK physical link packet OK slave transceiver packet OK source sink

(The “source” and “sink” are defined in the next section, “Half-duplex Protocol Environment.”

Half-duplex Protocol Environment

To define the environment of the protocol, the transceiver: • needs to know where to get the message it sends, the message source. We assume the message source: – supplies one message at a time upon request from the transceiver – requires notification of the success or failure of the transfer before supplying the next message • must have a means of disposing of messages it receives, the message sink When the transceiver has received a message successfully, it attempts to give it to the message sink. If the message sink is full, the transceiver will receive an indication that the sink is full.

Publication 1770-6.5.16 - October 1996

Page 41

3–4

Using Half-duplex Protocols to Send and Receive Messages

The following program describes the actions of the transceiver in detail: TRANSCEIVER is defined variables LAST-HEADER is 4 bytes copied out of the last good message BCC is an 8-bit block check accumulator LAST-HEADER = invalid loop reset parity error flag GET-CODE if it’s a DLE SOH then begin GET-CODE if it’s a data code and it matches the station number or it is 255 (the broadcast address) then begin BCC = the data code GET-CODE if it’s a DLE STX then begin RESPONSE = GETMESSAGE if RESPONSE is ACK then begin if message header is different from last and sink is not full begin save new HEADER try to send message to sink end if this is not a broadcast message and sink was not full then begin turn on RTS wait for CTS send DLE ACK turn off RTS end end end end end else if it’s a DLE ENQ then begin GET-CODE (the station number) GET-CHAR (the BCC) check the station number and the BCC, and if they’re OK then begin if there is a message left over from the last time and the transmit counter is exceeded then throw the message away and send an error code to the message source if there is no message then try to get one from the message source turn on RTS wait for CTS if there is still no message then send a DLE EOT else SEND the message turn off RTS end end else if it’s a DLE ACK then send a success code to the message source and discard the message else if it’s a DLE NAK then while the message source can supply a message begin get a message from the message source discard the message send an error code to the message source end end

Publication 1770-6.5.16 - October 1996

Page 42

Using Half-duplex Protocols to Send and Receive Messages

3–5

GETMESSAGE is defined as GET-CODE while it is data code begin if buffer is not overflowed put data in buffer GET-CODE end if it is a control code and it is an ETX then begin if parity error flag is set then return a NAK if BCC is not zero then return a NAK if message is too small then return a NAK if message is too large then return a NAK return an ACK end else end GET-CODE is defined as loop variable GET-CHAR if char is not a DLE begin add char to BCC return the char and a data flag end else begin GET-CHAR if char is a DLE begin add char to BCC return a DLE and a data flag end else if char is an ETX begin GET-CHAR add char to BCC return ETX with a control flag end else return char with a control flag end end end

GET-CHAR is defined as an implementation-dependent function that returns one byte of data from the link interface hardware SEND (Message) is defined as begin BCC = 0 send DLE STX for every byte in the message do begin subtract the byte from the BCC send the corresponding data code end send DLE ETX BCC end

Publication 1770-6.5.16 - October 1996

Page 43

3–6

Using Half-duplex Protocols to Send and Receive Messages

The following flowchart shows the software logic for implementing half-duplex protocol from the master node’s point of view: XCVR

Yes

Does master have message to send? No

Select node Send poll Start timeout

Receive DLE EOT?

No

Receive message? No

Yes

Node in active list?

Yes

Yes

No

Active node?

Duplicate message? No

Send message to application layer

Add node to active list Get message from application layer

3 timeouts this poll?

Send message

Yes

Start timeout

Yes

Received DLE ACK? No

3 timeouts this message? No

Publication 1770-6.5.16 - October 1996

Yes

Tell application layer of failure

Add node to inactive list

No

Yes

Yes

No

Message OK?

Send DLE ACK No

Yes

Send DLE ACK

Page 44

The text of this page cannot be shown here; see it in the PDF.

Page 45

The text of this page cannot be shown here; see it in the PDF.

Page 46

The text of this page cannot be shown here; see it in the PDF.