Rockwell Automation 1775-S5_SR5,D17756.5.5 User Manual PLC-3 FAMILY I/0 User Manual

Page 146

Advertising
background image

Binary Command Language

Appendix A

A-18

Read Block Command

Hex: 1F

Parameters: Starting address, size (in words) of the block

Description: The read block command reads a block of information
starting at a specific address. If you specify 0 for the size, the processor
returns the data from the address specified to the end of the section if this
does not include more than 63 words, or 63 words starting with the address
specified if the section is larger. The following example command block
reads the first two words of the input section:

STX

02

ISC

01

SIZ

08

CMD

1F

3C

02

00

ETX

03

CHK

6D

DAT

00

00

02

00

The data bytes store:

address mask (3C hex)
address byte specifying section 2 (input) (02 hex)
address byte specifying file 0 (00 hex)
address byte specifying structure 0 (00 hex)
address byte specifying word 0 (00 hex)
lower byte of size word (02 hex)
upper byte of size word (00 hex)

Notice that the size is specified in a word (two bytes). This is true of all
size specifiers within the data buffer of a command block.

The processor responds to a read block command with one of the
following response codes:

Response Codes

Hex

Description

00

Success

01

Size too big

04

Address unknown

05

Address invalid - end of section

06

Access not allowed

08

Address not complete

If a success, size too big, or address invalid – end of section code
returns, the next byte contains the number of data words returned. The
data follows this byte.

Advertising