Clear multiple bytes, Example routine – Rockwell Automation 56RF RFID System User Manual User Manual

Page 70

Advertising
background image

70

Rockwell Automation Publication 56RF-UM001A-EN-P - October 2011

Chapter 9

RSLogix 5000 Code Examples

Clear Multiple Bytes

The Clear Multiple Bytes command clears multiple bytes of user data in a RFID
tag. The user can specify the number of bytes to clear and the address from which
to begin. This is very similar to a “copy” command. It copies the value you specify
in the output data image Data[0] location to the addresses you specify.

Set the following values in the output image table:

a. xx:O.Channel[0].Command = 13
b. xx:O.Channel[0].Address = starting address
c. xx:O.Channel[0].BlockSize = 0
d. xx:O.Channel[0].Data[0] = 0 (or value used to clear the byte)
e. xx:O.Channel[0].Length = the number of bytes to clear
f. xx:O.Channel[0].Reset = 0
g. xx:O.Channel[0].Timeout = 0
h. xx:O.Channel[0].UIDLow = 0 (or UIDLow)
i. xx:O.Channel[0].UIDHi = 0 (or UIDHi)

Unless a UUID is specified, this command will operate on the first tag in the
field. Specify a UUID in xx:O.Channel[0].UIDLow and
xx:O.Channel[0].UIDHi to perform the command on a specific tag.

Example Routine

In the example routine below, the initialization in Rung 1 sets the address, length
data, the value used to clear the fields and sets the command value to 0. The
BlockSize, Reset, Timeout, UIDLow and UIDHi are set to 0 in the output image
table. The value to be copied is initially stored in the controller tag CMB_Data.
In the example below, CMB_Data is set to 0, but the user can set this to be any
valid SINT value.

Advertising