Identify the lane number, Reject bad characters – Rockwell Automation Logix5000 Controllers ASCII Strings Programming Manual User Manual

Page 22

Advertising
background image

Chapter 2 Processing ASCII characters

The sort_table_search tag controls the FSC instruction.

Although the previous instruction sets the Length of this instruction, you

enter an initial value to verify the project.

The product_id tag contains the bar code characters that you want to find.

Identify the Lane Number

Add the following rung to the routine to identify the LANE member.

When the FSC instruction finds the product ID within the sort_table array, the

instruction sets the FD bit. The POS member indicates the element number

within the sort_table array of the match. The corresponding LANE member

indicates the lane number of the match.

Based on the POS value, the MOV instruction moves the corresponding lane

number into the lane tag. The controller uses the value of this tag to route the

item.

After the MOV instruction sets the value of the lane tag, the RES instruction

resets the FSC instruction so it can search for the next product ID.

Reject bad characters

If the FSC instruction does not find the product ID within the sort_table array,

the instruction sets the DN bit. The MOV instruction moves 999 into the lane tag

to notify the controller to reject or reroute the item.

After the MOV instruction sets the value of the lane tag, the RES instruction

resets the FSC instruction so it can search for the next product ID.

22

Rockwell Automation Publication 1756-PM013D-EN-P - October 2014

Advertising