Example command routines - overview, Rung 0, Rung 1 – Rockwell Automation 56RF RFID System User Manual User Manual

Page 68

Advertising
background image

68

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

Chapter 9

RSLogix 5000 Code Examples

Example Command Routines
- Overview

Many of the example routines (not the Main Routine) use the same ladder logic.
The ladder logic is explained below.

Rung 0

Rung 0 initiates the routine. A sensor or momentary switch, connected to the
input connection of the RFID interface block, senses that an object (with an
RFID tag attached) is approaching and enables the execution of the read routine.
The sensor is the XIC bit labeled _RFID_1:I:Pt00Data. When the sensor
detects the object, the instruction latches ON.

Rung 1

Rung 1 initializes the output image table in preparation for command. Execution
begins when the transceiver is not already busy reading a tag and a tag is present in
the RF field.

This Examine If Closed (XIC) instruction is latched ON by the sensor in
Rung 0.

RFID_1:I:Channel[0]Busy – This Examine If Open (XIO) instruction prevents
the rung from executing when the transceiver is busy executing a command.

RFID_1:I:Channel[0].TagPresent – This XIC instruction closes when a tag is
present in the RF field of the transceiver connected to Channel[0].

MOV variable to RFID_1:O:Channel[0]:variable – Moves data from a
Controller tag to the output image table variable.

MOV 0 to RFID_1:0:Channel[0].Command – This initializes the output
command to 0.

Start – Latches a tag that indicates the function has started.

Unlatch – This unlatches (turns OFF) the instruction from Rung 0 and readies
the routine for the next RFID tag.

IMPORTANT

The transceiver executes a command when the command value changes.
When repeating a command, set the command value to 0 first and then re-set
it to the same desired value.

Advertising