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

The text of a manual · part 15 of 31

DF1 Protocol and Command Set Reference Manual: 7 - Communication Commands, pages 118 to 127

Pages 118 to 127 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 118

Communication Commands

Important:

7–31

The interface module at the receiving PLC node executes this command by first making a copy of the addressed PLC byte. It then sets or resets the appropriate bits and writes the byte back into PLC memory. At the same time, the PLC processor can be changing the states of the original bits in memory. Because of this, some data bits may unintentionally be overwritten.

unprotected read 1774-PLC, PLC-2, PLC-3, PLC-5 Reads words of data from any area of PLC and PLC-2 data table memory. In PLC-3 and PLC-5 processors, the data is read from the PLC-2 compatibility file. Use the SIZE field to specify the number of bytes to be read. To specify a number of PLC words, SIZE should be an even value because PLC words are two bytes long. Data bytes are transferred low byte first. The address of a word should be even.

• 1774-PLC • PLC-2 • PLC-3 • PLC-5 • SLC 500 • SLC 5/03 • SLC 5/04 • MicroLogix 1000

C

DST SRC CMD STS 01

TNS

R

SRC DST CMD STS 41

TNS

ADDR

SIZE

DATA (max. 244 bytes)

SLC 500, MicroLogix 1000 Reads data from a common interface file (CIF). The SLC 500 CIF is data file number 9, the MicroLogix 1000 CIF is integer file 7. This command is implemented as a protected file read in SLC processors and is used by non-SLC 500 devices to read information from SLC 500 devices. C

DST SRC CMD STS 01

TNS

R

SRC DST CMD STS 41

TNS

ADDR

SIZE

DATA

Address - Logical offset into the CIF. SLC 500, SLC 5/01 and SLC 5/02 (SLC 5/02 prior to series C FRN 3) processors use word addressing SLC 5/02 series C FRN 3 and later, SLC 5/03, and SLC 5/04 processors select word or byte addressing for S:2/8 = 0 (default) word addressing is used for S:2/8 = 1 byte addressing is used Size - Number of bytes to read starting from the offset. for SLC 500, SLC 5/01 and SLC 5/02 processors: valid range is 0 - 95 bytes (odd or even) for SLC 5/03 and SLC 5/04 processors - with internet protocol: valid range is 0 - 225 bytes (odd or even) - without internet protocol: valid range is 0 - 236 bytes (odd or even)

Publication 1770-6.5.16 - October 1996

Page 119

7–32

Communication Commands unprotected write 1774-PLC, PLC-2, PLC-3, PLC-5 Writes words of data into any area of PLC and PLC-2 data table memory. In PLC-3 and PLC-5 processors, the data is written into the PLC-2 compatibility file. • 1774-PLC • PLC-2 • PLC-3 • PLC-5 • SLC 500 • MicroLogix 1000

C

DST SRC CMD STS 08

TNS

R

SRC DST CMD STS 48

TNS

ADDR

Data (max. 244 bytes)

SLC 500, MicroLogix 1000 Writes data to a common interface file (CIF). The SLC CIF is data file number 9; the MicroLogix CIF is integer file 7. C

DST

CMD STS 08

TNS

R

SRC DST CMD STS 48

TNS

SRC

Address Low High

Data (size implied by data sent)

Address - Logical offset into the CIF. Value is in words or bytes as shown below: SLC 500, SLC 5/01 and SLC 5/02 (SLC 5/02 prior to series C FRN 3) processors use word addressing SLC 5/02 series C FRN 3 and later, SLC 5/03, and SLC 5/04 processors select word or byte addressing for S:2/8 = 0 (default) word addressing is used for S:2/8 = 1 byte addressing is used Data - Data to be written. This size of the data is implied by the number of data bytes sent. for SLC 500, SLC 5/01 and SLC 5/02 processors: valid range is 0 - 94 bytes (odd or even) for SLC 5/03 and 5/04 processors - with internet protocol: valid range is 0 - 223 bytes (odd or even) without internet protocol: valid range is 0 - 234 bytes (odd or even)

Publication 1770-6.5.16 - October 1996

Page 120

Communication Commands

7–33 upload all request (upload) Places a PLC-5 processor in Upload mode before uploading a complete system. (A T50 terminal displays “download” mode.) • PLC-5 • PLC-5/VME

A “no privilege“ error is returned if the programmed device does not have the privilege of placing the processor into Upload mode. This error occurs when: • the processor is being edited • some other node is already uploading or downloading to the processor If you have an earlier version of a PLC-5 processor, this error may occur if your processor is not in Program or Remote Program mode. C

DST SRC CMD STS 0F

R

PLC-5/15 Series A and Series B Revision E and earlier SRC DST CMD STS 4F

TNS

TNS

FNC 53

EXT STS

PLC-5/15 Series B Revision F and later and all other PLC-5 family processors SRC DST CMD STS 4F

TNS

A

B

C

D

The EXT STS field may be attached to the reply packet only when there is an error. A - number of uploadable segments of PLC-5 memory in the remote PLC-5 processor B - (eight bytes for each segment specified in A.) First 4 bytes contain the starting address of the segment. The second 4 bytes contain the ending address of the segment. C - number of comparable memory segments. D - (eight bytes for each segment specified in C.) The first four bytes contain the starting address of the segment. The second four bytes contain the ending address of the segment. A, B, C, D - These fields may be replaced by an EXT STS field if there is an error.

If you are using a PLC-5 family processor other than a PLC-5/15 (Series A or Series B Revision E or earlier), you also receive data about uploadable and comparable memory segments: Segment

Description uploadable memory

Contiguous segments of the PLC-5 memory that must be uploaded.

comparable memory

Uploadable contiguous memory segments that you can compare to an uploaded segment to verify the contents. For example, a segment of memory that contains ladder logic is comparable, but a segment that contains data table memory is not because because data table memory is constantly changing.

Publication 1770-6.5.16 - October 1996

Page 121

7–34

Communication Commands upload completed After uploading a complete system, use to return the processor to the mode it was in prior to executing the upload all request command. • PLC-5 • PLC-5/VME

C

DST SRC CMD STS 0F

TNS

FNC 55

R

SRC DST CMD STS 4F

TNS

EXT STS

The EXT STS field may be attached to the reply packet only when there is an error.

upload Informs the interface module that it wants to perform an upload. If the module grants the upload privilege, the computer issues physical reads. If another node already has the upload privilege, the second node is denied the privilege.

• PLC-3

C

DST SRC

CMD STS 0F

TNS

FNC 06

R

SRC DST

CMD STS 4F

TNS

EXT STS

The EXT STS field may be attached to the reply packet only when there is an error.

word range read (read block) Reads a word or file starting at a specified address. A special case of this command is a single-word read, where the number of bytes to read is only two bytes (one word). This command must always be an even number of bytes. • PLC-3 • PLC-5

C

DST SRC

CMD STS 0F

TNS

R

SRC DST

CMD STS 4F

Data - max. 244 bytes or 122 words)

FNC 01

Packet Offset

Total Trans

PLC sys. address

Size

The DATA field may be replaced by an EXT STS field if there is an error.

Publication 1770-6.5.16 - October 1996

For this processor

The starting address can be a

PLC-3 word symbol, file symbol plus a word offset, or a block address. The starting address must point to a word in a file.

PLC-5 logical binary address or a logical ASCII address of up to 51 bytes.

Page 122

Communication Commands

7–35 word range write (write block) Writes to a word or file starting at a specified address. A special case of this command is the single-word write, where the data field is only one word long.

• PLC-3 • PLC-5 C

DST SRC

CMD STS 0F

TNS

FNC 00

R

SRC DST

CMD STS 4F

TNS

EXT STS

Packet Offset

Total Trans

PLC system address

Data (max. 240 bytes the PLC address field)

The EXT STS field may be attached to the reply packet only when there is an error.

For this processor

The starting address can be a

PLC-3 word symbol, file symbol plus a word offset, or a block address. The starting address must point to a word in a file.

PLC-5 logical binary address or a logical ASCII address of up to 51 bytes.

write bytes physical (physical write) Performs a download only after receiving a reply that the download (or upload) all request has been successfully performed. • PLC-5 • PLC-5/VME

C

DST SRC CMD STS 0F

TNS

FNC 18

R

SRC DST

CMD STS 4F

TNS

EXT STS

PLC-5 phys. address

A

The EXT STS field may be attached to the reply packet only when there is an error. PLC-5 physical address - contains the address you are writing to. A - Up to 238 bytes can be written with a single command (low byte of the word first). (Must be an even number of data bytes.)

Publication 1770-6.5.16 - October 1996

Page 123

7–36

Communication Commands

PLC-5 Type/Data Parameter Examples

The type/data parameter is a variable length field. The most significant bit of each nibble determines additional bytes used. The value of this field can be extended to a 7-byte unsigned integer. The bytes are ordered least to most significant. All zero most-significant bytes are permitted, but the fields generated by them are no different than those that omit these insignificant bytes. The following three descriptors are all permitted and equivalent: Important:

Your software must be able to handle all three cases.

Case 1

Case 2

Case 3

0100 0011

0100 1001

0100 0011

0000 0011

0100 1010 0000 0011 0000 0000

These all have an ID value of 4 and a size value of 3. Example 1: Type/data parameter for writing or reading integer data This example shows the type/data parameter for writing or reading integer (ID = 4) data, with each element of data 2 bytes long. 0

Publication 1770-6.5.16 - October 1996

1

0

0

0

0

1 type ID data size type ID contained in bits 6, 5, 4 data size contained in bits 2, 1, 0

0 flag byte

Page 124

Communication Commands

7–37

Example 2: Type/data parameter for writing or reading integer data This example shows the type/data parameter for reading an array (ID = 9). The array data type includes an additional byte called the descriptor byte, located after the ID byte. The descriptor byte is a second flag byte which describes the type of data in the array. You include the descriptor byte as part of the data field size. Bit 76543210 flag byte

10010111 00001001

Bits 4 - 7: Data Type ID in next one byte Bits 0 - 3: bytes per data type equals seven (6 data bytes plus 1 descriptor) ID Value = 9 (array)

01000010

Integer descriptor, size = 2 bytes each

00000000

Integer 0, (LS)

00000000

(MS)

11111110

Integer 1, (LS)

11111111

(MS)

11111111

Integer 2, (LS)

00000000

(MS)

Value = 0

Value = -2

Value = 255

Not all sizes are legal for all formats. The “B” data type always has a size value of one. The “F” data type has either a size value of four (single precision) or eight (double precision). Each of the Allen-Bradley predefined structures has a fixed size. Example 3: PLC-5 processor requesting I0 integer words 10011010

Bits 4 - 7: Data Type ID in next byte Bits 0 - 3: Size encoded in next two bytes after type

00001001

ID Value = 9 (array)

00010101

Extended size = 15hex = 21 First byte of extended size (LS) 21 = one byte for type and twenty bytes of data to follow Second byte of extended size (MS)

00000000 01000010

Bits 4 - 7: Data Type = 4 = integer BIts 0 - 3: Size = two bytes per element

Publication 1770-6.5.16 - October 1996

Page 125

7–38

Communication Commands

SLC 500 Information

Reading and Writing SLC 500 Data

Reading and Writing SLC 500 Data (using PLC-2 terminology)

Publication 1770-6.5.16 - October 1996

Important:

There are also some limitations on the basic commands SLC 500 family nodes support:

Command

Limitation

Diagnostic Loop

Maximum data field size is 95 bytes, not 243.

Unprotected Read

Maximum data field size is 95 bytes, not 244. In addition, the Addr field is used as a word address instead of a byte address, and the Size field may contain either an even or odd value.

Unprotected Write

Maximum data field size is 94 bytes, not 244. In addition, the Addr field is used as a word address instead of a byte address.

When using SLC terminology: • The address field in the unprotected read and unprotected write commands is used as the word offset into the file • Thus, to read N9:9 from an SLC 500, put 9 in the address field (after converting it to 09 hex) Important:

The address fields of unprotected reads and unprotected writes are used as word addresses instead of the byte addresses used in the PLC-2, 1774-PLC, and PLC-5 processor. Because of this, existing software drivers that communicate with the these processors do not work with SLC 500 family processors, unless you set bit S:2/8 to a logical one. The SLC 500 processor then changes to byte addressing mode. This bit is reset to logical zero by default.

Page 126

Communication Commands

7–39

You can map the SLC 500 CIF file to PLC-2 memory as shown in the following example. The maximum size of PLC-2 memory that you can simulate is 256 words (octal 00 through 377). Example: Reading SLC 500 data using SLC and PLC-2 terminology SLC Logical Address

High Byte

Low Byte

Octal Address

N9:0

Byte #1

Byte #0

000

N9:1

Byte #3

Byte #2

001

N9:2

Byte #5

Byte #4

002

N9:3

Byte #7

Byte #6

003

N9:4

Byte #9

Byte #8

004

N9:5

Byte #11

Byte #10

005

N9:6

Byte #13

Byte #12

006

N9:7

Byte #15

Byte #14

007

N9:8

Byte #17

Byte #16

010

N9:9

Byte #19

Byte #18

011

N9:10 . .

Byte #21 . .

Byte #20 . .

012

.

.

.

.

N9:255

Byte #511

Byte #510

377

PLC-2 Memory Map

. .

Publication 1770-6.5.16 - October 1996

Page 127

7–40

Communication Commands

Example: Reading the 18th and 19th bytes shown in the example on page 7-39 These examples compare two methods for reading SLC 500 data from an SLC 500 (assumes S:2/8 = 0 so that word addressing is selected) and from a PLC-2 processor. When using the SLC 500 method, you do not multiply by two (as in step 2, below) as you do with the PLC-2 method. Read N9:9 from SLC 500 processor: 1. Convert decimal element to hex: 9 (decimal)

0009 (hex)

2. Put low byte first in address field: Address 09 00h

Size xxh

3. Put 02 (hex) in size field (2 bytes = 1 word): Address 09 00h

Size 02h

Read octal word 011 from PLC-2 processor: 1. Convert octal element to hex: 11 (octal)

0009 (hex)

2. Multiply by 2: 0009h x 2 = 0012h 3. Put low byte first in address field: Address 12 00h

Size xxh

4. Put 02 (hex) in size field (2 bytes = 1 word): Address 12 00h

Publication 1770-6.5.16 - October 1996

Size 02h