Write byte, Read multiple blocks, Example routine – Rockwell Automation 56RF RFID System User Manual User Manual

Page 115

Advertising
background image

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

115

MicroLogix 1400 Code Examples

Chapter 11

Write Byte

The Write Byte command (value = 14) writes bytes of user data to a tag. The user
can specify the data, the start byte, and the number of bytes to write.

Note:

This command operates only on the first tag in the field.

Example Routine

• Rung 0000:

Place RFID interface into the Run Mode. The bit should be

highlighted in green. If the bit is not green, right-click it and click Toggle
Bit

.

• Rung 0001:

Read Input Image. Double-click the MSG box to enter the

Setup Screen. Input Size is 116 bytes (58 words). Click on the MultiHop
tab to set up an EtherNet/IP Device.

• Rung 0002:

Write Output Image. Double-click the MSG box to enter the

Setup Screen. Output Size is 124 bytes (62 words). Click on the MultiHop
tab to set up an EtherNet/IP Device.

• Rung 0003:

The Tag Present bit will be highlighted in green when a tag is

present. When a tag is present, clear the command value.

• Rung 0004:

When the command value has been cleared, load in the

instruction parameters contained in N114 (Write Byte). N110 (Write
Single Block) could be used in place of N114.

• Rung 0005:

Wait for the write command to run. The Write in Progress bit

will be highlighted in green when the command is running. When the
command has completed, the Write in Progress bit will return to its
original state. When the command has been executed and completed, copy
the data read into N100.

• Rung 0006:

If there was an error with the operation, then N100:0 will

contain the error code.

Read Multiple Blocks

The Read Multiple Blocks command (value = 2) reads multiple blocks of user
data from a tag. Additionally, Option Flags can be set to return information such
as the Universally Unique Identifier (UUID) or the Data Storage Format
Identifier (DSFID) of the tag.

• Option Flag 0

– Returns multiple blocks of user data

• Option Flag 1

– Returns multiple blocks of user data and the security

status of each block

Note:

Unless a UUID is specified, this command will operate on the first tag in

the field.

Example Routine

• Rung 0000:

Place RFID interface into the Run Mode. The bit should be

highlighted in green. If the bit is not green, right-click it and click “Toggle
Bit”.

Advertising