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

The text of a manual · part 28 of 31

DF1 Protocol and Command Set Reference Manual: 14 - Line Monitor Examples

Pages 233 to 240 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 233

Chapter

14

Line Monitor Examples This chapter contains line monitor examples for DF1 protocol. Each example shows how actual commands and replies look on a line monitor (bytes are shown in hexadecimal). It contains these sections: Section

Page

Half-duplex Line Monitor Example

14-2

Full-duplex PLC-2 Line Monitor Example

14-3

Full-duplex PLC-3 Line Monitor Example

14-6

Publication 1770-6.5.16 - October 1996

Page 234

14–2

Line Monitor Examples

Half-duplex Line Monitor Example

When monitoring half-duplex protocol in two-wire mode, you need to monitor only one line. The example below shows a message sent by the master and a reply sent by the slave in response to a poll. Slave responses are in boldface: Message from master to slave and slave acknowledgement: DLE SOH stn DLE STX message DLE ETX CRC DLE ACK

Message sent from slave to master in response to poll and slave acknowledgement: DLE ENQ stn BCC DLE STX message DLE ETX CRC DLE ACK

Poll with a DLE EOT in response: DLE ENQ stn BCC DLE EOT

Use the following CRC example to verify your CRC routine: master:

DLE 10

SOH STN 01 11 slave:

DLE 10

ACK 06 master:

DLE 10

ENQ STN 05 11

BCC EF slave:

DLE 10

STX 02

DST 07

SRC CMD STS 11 41 00 master:

DLE 10

ACK 06

DLE 10

ENQ 05 slave:

DLE 10

EOT 04

Publication 1770-6.5.16 - October 1996

DLE 10

STX 02

STN 11

DST 11

BCC EF

SRC CMD STS 07 01 00

TNS 4100

TNS 4100

ADDR 1200

SIZE 0C

DATA 00 00 00 00 00 00 00 00 00 00 00 00

DLE 10

ETX 03

DLE ETX 10 03

CRC CF 40

CRC CF 40

Page 235

Line Monitor Examples

Full-duplex PLC-2 Line Monitor Example

14–3

In the following example an unprotected read (CMD 01 hex) is sent: • from a computer connected to a 1770-KF2 with Data Highway node address 012 (octal) • to the PLC-2/30 connected to a 1771-KA2 with Data Highway node address 011 (octal) DH link node 012

1770-KF2

1771-KA2 computer

PLC-2/30 node 011

Command Path 1

DLE

STX

DST

SRC

CMD

STS

TNS

10

02

09

00

01

00

01

ADDR 00

11

00

SIZE

DLE

ETX

BCC

02

10

03

E2

Path 2

DLE

ACK

10

06

Reply (sometime later) Path 1 Path 2

DLE

STX

DST

SRC

CMD

STS

TNS

10

02

0A

09

41

00

01

DATA 00

FF

FF

DLE

ETX

BCC

10

03

AD DLE

ACK

10

06

Publication 1770-6.5.16 - October 1996

Page 236

14–4

Line Monitor Examples

Command Field DLE STX (2 bytes) DST (destination)

Value 10 02 09

SRC (source)

00

CMD (command)

01

STS TNS (transaction) (2 bytes)

00 01 00

ADDR (address) (2 bytes)

11 00

SIZE DLE ETX (2 bytes) BCC (block check character)

02 10 03 E2

DLE ACK

10 06

Function Indicates the start of a message Indicates the remote node address that the computer is communicating to. 09 hex equals 011 octal, the address of the 1771-KA2. Indicates the Data Highway node address that is the source of the message. In this example, the computer uses an SRC byte of 00 (hex). The asynchronous interface (1770-KF2) automatically inserts the correct SRC value before sending the message across Data Highway to the 1771-KA2. Indicates the specific type of command. In this example, the CMD byte has the value 01 (hex) which indicates an unprotected read of the PLC-2/30 data table. Indicates the status of the message. A command message should always set this field to 00 (hex). Indicates a specific transaction value for each message. The TNS value increments for each message packet. This value makes each message uniquely different, which helps you check for duplicate message packets. Specifies the PLC-2 data table address where the unprotected read starts. The combination of these two bytes points to a byte address. Since the PLC-2 works in word (2 byte) increments, the address should specify an even number of bytes. The address must be transferred low byte first. In our example, the address 11 00 (hex, low byte first) equals 000 022 octal byte address or 000 011 octal word address. Specifies how many bytes of PLC-2 data table information you read in this transaction. Indicates the termination of the message. Used to check the accuracy of the message transmission. You can optionally use CRC bytes here. The BCC value must equal the 2's compliment of the 8-bit sum of all data bytes between DLE STX and DLE ETX. (For more information on BCC and CRC error checking, see page 5-4 .) Sent from the module (1770-KF2) back to the computer to indicate that the module successfully received the message. If the BCC value calculated by the module does not match the BCC value in the message packet, the module sends a DLE NAK (10 15) instead of the DLE ACK (hex).

Publication 1770-6.5.16 - October 1996

Page 237

Line Monitor Examples

Reply Field DLE STX (2 bytes) DST (destination)

Value 10 02 0A

SRC (source)

09

CMD (command)

41

STS (status)

00

TNS (transaction) (2 bytes)

01 00

DATA

FF FF

DLE ETX (2 bytes) BCC (block check character)

10 03

DLE ACK

AD

10 06

14–5

Function Indicates the start of the reply message Indicates the node address that the reply is being sent back to. In our example command message, the 1770-KF2 put its address in the source (SRC) byte before sending the command message to the 1771-KA2. The 1771-KA2 takes the source byte from the command message and makes it the destination byte of the reply message. In our example, the reply message is sent back to the 1770-KF2, node address 012 octal (0A hex). Indicates the Data Highway node address that is the source of the message. In this example, the reply is being sent from the 1771-KA2 at node address 011 octal (09 hex). Indicates the specific type of command. In a reply packet, 40 hex is added to the CMD byte to indicate that the packet is a reply. In this example, the CMD byte in the command message was 01 hex (unprotected read), so the CMD byte in the reply message is 41 hex. Indicates the status of the message. If there is a problem with the message or the network, a status code appears in this byte. In our example, the message is successful (status code 00 hex). (For a list of status codes, see Chapter 8, Packet Status Codes (STS, EXT STS).") Indicates a specific transaction value for each message. The TNS value for the reply message is the same as the TNS value for the command message. This allows the computer to keep track of commands and their associated replies. In our example, the computer reads two actual bytes of data from the PLC-2/30 data table (octal word 011). These bytes of data are FF FF hex (1111 1111 1111 1111 binary). This indicates that all 16 bits at octal word 011 are set on. Indicates the termination of the reply message. Used to check the accuracy of the message transmission. You can optionally use CRC bytes here. The BCC value must equal the 2's compliment of the 8-bit sum of all data bytes between DLE STX and DLE ETX. (For more information on BCC and CRC error checking, see page 5-4.) Sent from the computer back to the module (1770-KF2) to indicate that the computer successfully received the message. If the BCC value calculated by the module does not match the BCC value in the message packet, the module sends a DLE NAK (10 15 hex) instead of the DLE ACK (hex). If the module does not receive a DLE ACK or DLE NAK from the computer within approximately one second (1771-KE, -KF, -KG only), it sends a DLE ENQ to see if re-transmission is necessary.

Publication 1770-6.5.16 - October 1996

Page 238

14–6

Line Monitor Examples

Full-duplex PLC-3 Line Monitor Example

In this example three word range reads (CMD 0F, FNC 01) are sent: • from a computer connected to a 1770-KF2 with DH node address 012 (octal) • to the PLC-3 connected to a 1775-KA with DH node address 011 (octal) This example requires three commands and the corresponding replies to read 684 bytes of data from the PLC-3 processor. The following describes the first command and reply fields only. The fields of the second and third commands and their replies are the same except for the TNS, PACKET OFFSET, and BCC fields:

Command #1: Path 1

DLE

STX DST SRC CMD STS

TNS

PACKET FNC OFFSET

TOTAL TRANS

10

02

02 00

01

56

09

00

0F

00

00

00

ADDRRESS

01 2C 08

0A

00

SIZE

DLE

ETX

BCC

E4

10

03

6C

Path 2

DLE

ACK

10

06

Reply #1 (sometime later) Path 1

DLE STX DST SRC CMD STS

TNS

DATA FROM PLC-3

DLE

ETX

BCC

10

02 00

<<228 bytes of data>>

10

03

9C

02

0A

09

4F

00

Path 2

Command #2 Path 1

DLE

STX DST SRC CMD STS TNS

PACKET FNC OFFSET

TOTAL TRANS

10

02

01

56

09

00

0F

00

03 00

72

00

ADDRRESS

01 2C 08

0A

00

DLE

ACK

10

06

SIZE

DLE

ETX

BCC

E4

10

03

F9

Path 2

DLE

ACK

10

06

DLE

ACK

10

06

Reply #2 (sometime later) Path 1

DLE STX DST SRC CMD STS

TNS

10

03 00

02

0A

09

4F

00

DATA FROM PLC-3 <<228 bytes of data>>

DLE

ETX

BCC

10

03

9B

Path 2

DLE

ACK

10

06

Command #3 Path 1

DLE STX DST SRC CMD STS

TNS

PACKET FNC OFFSET

TOTAL TRANS

10

04 00

01

56

02

09

00

0F

00

E4

00

ADDRRESS

01 2C 08

0A 00

SIZE

DLE

ETX

BCC

E4

10

03

86

Path 2

Reply #3 (sometime later) Path 1

DLE STX DST SRC CMD STS

TNS

10

04 00 <<228 bytes of data>>

02

0A

09

4F

Path 2

Publication 1770-6.5.16 - October 1996

00

DATA FROM PLC-3

DLE

ETX

BCC

10

03

9A DLE

ACK

10

06

Page 239

Line Monitor Examples

14–7

Command Field DLE STX (2 bytes) DST (destination)

Value 10 02 09

SRC (source)

00

CMD (command)

0F

STS TNS (transaction) (2 bytes)

00 02 00

FNC (function)

01

PACKET OFFSET (2 bytes)

00 00

TOTAL TRANS (total transaction) (2 bytes)

56 01

ADDRESS (variable number of bytes)

2C 08 0A 00

SIZE

E4

DLE ETX (2 bytes) BCC (block check character)

10 03 6C

DLE ACK

10 06

Function Indicates the start of a message Indicates the remote node address that the computer is communicating to. 09 hex equals 011 octal, the address of the 1771-KA2. Indicates the DH node address that is the source of the message. In this example, the computer uses an SRC byte of 00 (hex). The asynchronous interface (1770-KF2) automatically inserts the correct SRC value before sending the message across the DH link to the 1775-KA. Indicates the type of command. In this example, the CMD byte has the value 0F (hex) which points to a group of PLC-3 commands. The FNC byte specifies which command in the group is sent. Indicates the status of the message. A command message should always set this field to 00 (hex). Indicates a specific transaction value for each message. The TNS value increments for each message packet. This value makes each message uniquely different, which helps you check for duplicate message packets. In this example, there are three commands, and each must have a different TNS value. Used with the CMD byte, this byte determines which command is sent. The CMD byte specifies a group of commands, and the FNC byte specifies a command within that group of commands. In this example, the FNC byte specifies command 01 of command group 0F. (This is the word range read command.) Contains the offset from the address in the address field. In this example, the computer sends three commands for one transaction. Each command reads 114 words. The first command starts at the address in the ADDR field with no offset. The second command has an offset of 72 00 (00 72 hex = 114 decimal). This means that the second command begins reading after the 114 words that were read by the first command. Likewise, the third command has an offset of E4 00 (00 E4 hex = 228 decimal). Indicates the total amount of PLC-3 data table words (low byte first) that are transferred for the entire transaction. In this example, there are three commands to complete the single transaction. The TOTAL TRANS equals 56 01 (01 56 hex = 342 words decimal or 684 bytes). If a file does not contain as many bytes as the TOTAL TRANS field, the transaction is rejected and you receive an error code in the status and extended status fields. Specifies the PLC-3 data table address where the word range read will start. The combination of these bytes specifies the address flag, data table area, context, section, file, structure, and word location where the command will be executed. Not all commands need to specify all six levels. (For information on converting a PLC-3 address, see page 13-4.) In our example, we read PLC-3 binary file 10, word 0 which converts to 2C 08, 0A 00. Specifies how many bytes of PLC-3 data table information you read in this transaction. The word range read command reads a maximum of 244 bytes per message packet. In this example, each of the three commands reads 228 bytes (E4 hex). Indicates the termination of the message. Used to check the accuracy of the message transmission. You can optionally use CRC bytes here. The BCC value must equal the 2's compliment of the 8-bit sum of all data bytes between DLE STX and DLE ETX. (For more information on BCC and CRC error checking, see page 5-4.) Sent from the module (1770-KF2) back to the computer to indicate that the module successfully received the message. If the BCC value calculated by the module does not match the BCC value in the message packet, the module sends a DLE NAK (10 15 hex) instead of the DLE ACK (hex).

Publication 1770-6.5.16 - October 1996

Page 240

14–8

Line Monitor Examples

Reply Field DLE STX (2 bytes) DST (destination)

Value 10 02 0A

SRC (source)

09 p

CMD (command)

4F

STS (status)

00

TNS (transaction) (2 bytes)

02 00

DATA

228 bytes

DLE ETX (2 bytes) BCC (block check character)

10 03

DLE ACK

10 06

Function Indicates the start of the reply message Indicates the node address that the reply is being sent back to. In our example command message, the 1770-KF2 put its address in the source (SRC) byte before sending the command message to the 1775-KA. The 1775-KA takes the source byte from the command message and makes it the destination byte of the reply message. In our example, the reply message is sent back to the 1770-KF2, node address 012 octal (0A hex). Indicates the Data Highway node address that is the source of the message. In this example, the reply is being sent from the 1775-KA at node address 011 octal (09 hex). Indicates the type of command. In a reply packet, 40 hex is added to the CMD byte to indicate that the packet is a reply. In this example, the CMD byte in the command message was 0F hex (unprotected read), so the CMD byte in the reply message is 4F hex. Indicates the status of the message. If there is a problem with the message or the network, a status code appears in this byte. If the STS byte equals F0 or E0 hex, the exact error is contained in an EXT STS (extended status) byte. (For more information on STS codes, see page 8-2.) In our example, the message is successful (status code 00 hex). Indicates a specific transaction value for each message. The TNS value for the reply message is the same as the TNS value for the command message. This allows the computer to keep track of commands and their associated replies. Since our example has three commands, each command must have a different TNS field. In our example, the computer reads 228 bytes (114 words) of actual data from the PLC-3 data table starting at B10:0. Each word of data is presented low byte first. The second read command starts at B10:114 and the third at B10:228 based on the packet offset field. Indicates the termination of the reply message. Used to check the accuracy of the message transmission. You can optionally use CRC bytes here. The BCC value must equal the 2's compliment of the 8-bit sum of all data bytes between DLE STX and DLE ETX. Sent from the computer back to the module (1770-KF2) to indicate that the computer successfully received the message. If the BCC value calculated by the module does not match the BCC value in the message packet, the module sends a DLE NAK (10 15 hex) instead of the DLE ACK (hex). If the module does not receive a DLE ACK or DLE NAK from the computer within approximately three seconds, it sends a DLE ENQ to see if re-transmission is necessary.

Publication 1770-6.5.16 - October 1996