Page 93

Petruzella_ProgrammableLogicControllers__5e

Each conveyor has a limit switch used to count parts as they pass by. The operation of the parts tracking program of the process can be summarized as follows: • The Main_Conveyor_Counter.ACC contains the total number of parts that have been counted. • The Reject_Conveyor_Counter.ACC contains the number of parts that have been rejected. Reject_Conveyor_LS <Local:1:I.Data.1> Main conveyor Main conveyor LS Reset PB Ladder logic program Reject conveyor LS Diverter gate Figure 15-94  Conveyor parts tracking program. 382 Part 5  Math, Comparison, and Move Instructions CTU CTU 5000 0 Reject_Conveyor_Counter SUB Reject conveyor Inputs Main_Conveyor_LS <Local:1:I.Data.0> Main_Conveyor_LS <Local:1:I.Data.0> Reject_Conveyor_LS Reject_Conveyor_LS <Local:1:I.Data.1> Reset_PB <Local:1:I.Data.2> Main_Conveyor_Counter Reject_Conveyor_Counter RES RES CLR TOD CU DN CU DN Count Up Counter Preset Accum Count Up Counter Preset Accum Main_Conveyor_Counter 5000 0 Main_Conveyor_Counter.ACC 0 0 0 Reject_Conveyor_Counter.ACC 0 0 0 Subtract Data_Format_Conversion Data_Format_Conversion Data_Format_Conversion Source A Source B To BCD BCD_Output_Display Source Dest Dest Dest Clear Reset_PB L1 Output L2 0 0 0 0 BCD_Display Main_Conveyor_LS • The SUB instruction is used to provide a running count of items that have passed inspection and has as its Destination the Data_Format_Conversion tag. • BCD_Output_Display is used to show the running count for passed items. • Reset_PB switch is activated to reset both counters to zero and clear the BCD_ Output_Display to zero.


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above