Readćmodifyćwrite n – Rockwell Automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command User Manual

Page 108

Advertising
background image

7–21

Communication Commands

Publication 1770Ć6.5.16 - October 1996

readĆmodifyĆwrite N

Sets or resets specified bits in specified words of data table memory.
The variable N lets you specify the number of sets modified.
The interface that receives this command performs this procedure for
each PLC-5 system address, AND Mask, and OR Mask in the
message packet:

1.

Copies the specified word in the data table.

2.

Resets the bits specified in the AND mask.

3.

Sets the bits specified in the OR mask.

4.

Writes the word back to its location.

Important: The controller may change the states of the original bits

in memory before this command can write the word
back to memory. (Some data bits may unintentionally
be overwritten.) To help prevent this, we suggest that
you use this command to write into the storage area of a
programmable controller’s data table, and have the
controller read the word only, not control it.

(Repeatable up to 243 bytes)

CMD

0F

STS

FNC

79

TNS

C

CMD

4F

STS

TNS

R

TNS

DST SRC

SRC DST

EXT

STS

AND Mask

PLCĆ5 sys. address

OR Mask

Mask

Length

2 or 4

bytes

2 or 4

bytes

Reply

If present

(Repeated for

more sets

No. of

Sets

The PLCĆ5 system address specifies the word that is modified. Use more than one field to

specify more than one word. Must point to a word, and can be either a logical binary address or a

logical ASCII address.

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

low word, low byte and low word, high byte. Optionally, includes high word, low byte and high word,

high byte.

Each PLCĆ5 system address field is followed by:

Mask Length Ċ indicates the lengths of AND Mask and OR Masks

AND Mask Ċ specifies which bits in the word to reset; 0 to reset a bit, 1 to leave it the same

OR Mask Ċ specifies which bits in the word to set ; 1 to set a bit, 0 to leave it the same

These three fields, along with the PLCĆ5 system address field, can be repeated up to a length of 243 bytes.

PLCĆ5/250

ONLY

Advertising