1 / 7

Do-more Technical Training

Learn about the Program Looping Instruction Set in Do-more PLC, including BREAK, CONTINUE, FOR/NEXT, REPEAT/UNTIL, and WHILE/WEND. Find the maximum value in D4000-4009 and store it in D4010.

bomberger
Download Presentation

Do-more Technical Training

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Do-more Technical Training Instruction Set (Program-Looping)

  2. Instruction Set (Program-Looping) • Program-Looping (8) • BREAK • CONTINUE • FOR/NEXT • REPEAT/UNTIL • WHILE/WEND

  3. Instruction Set (Program-Looping) Finds maximum value in D4000-4009Stores maximum value in D4010 D4010 (maximum value) is initialized to zero • BREAK“Exit Loop” • Breaks out of FOR/NEXT, WHILE/WEND or REPEAT/UNTIL loop • Skips over instructions between BREAK and the NEXT, WEND, or UNTIL instruction • No more iterations of the loop are done • Execution continues with instruction immediately following NEXT, WEND, or UNTIL • Skipping instruction However, if any value is found in D4000-4009 that is negative, looping is stopped FOR/NEXT loop iterates through range V100 = 4000-4009 Maximum value is stored in D4010

  4. Instruction Set (Program-Looping) Finds maximum value in D4000-4009Stores maximum value in D4010 D4010 (maximum value) is initialized to zero • CONTINUE“Skip to Loop End” • Skips over instructions between CONTINUE and the NEXT, WEND, or UNTIL instruction • Similar to BREAK except that the loop is not terminated • Execution continues with the next iteration of the loop next time the code block is scanned • Skipping instruction However, if any value is found in D4000-4009 that is negative, looping is continued at next iteration FOR/NEXT loop iterates through range V100 = 4000-4009 Maximum value is stored in D4010

  5. Instruction Set (Program-Looping) • FOR“Index Loop” • Designates the beginning of a loop in which instructions between FOR & NEXT are executed a predefined number of times • No limit to nesting • Unconditional • To make conditional place in Task and use ENTASK • Parameters: • Index – memory initialized to the From value and incremented by the By Step value • From – memory/constant that initializes Index • To – memory/constant that designates the last loop value • By Step – memory/constant by which Index is incremented by for each loop iteration • NEXT “Index by Step” • Designates the end of a FOR loop • Yielding instruction Finds the maximum value in the range of D4000 - 4009

  6. Instruction Set (Program-Looping) • REPEAT“Loop Until Condition is Non-Zero” • Designates the beginning of a loop in which instructions between REPEAT & UNTIL are executed until the ending Ending Condition is non-zero • No limit to nesting • Unconditional • To make conditional place in Task and use ENTASK • UNTIL“Repeat Until Condition is Non-Zero” • Designates the end of a REPEAT loop • Parameters: • Ending Condition – memory location that if contains a non-zero value terminates the loop • Yielding instruction Ladder Code Ladder Code

  7. Instruction Set (Program-Looping) • WHILE“Loop While Condition is Non-Zero” • Designates the beginning of a loop in which instructions between WHILE & WEND are executed while the Condition is non-zero • Similar to REPEAT/UNTIL • No limit to nesting • Unconditional • To make conditional place in Task and use ENTASK • WEND“While End” • Designates the end of a WHILE loop • Yielding instruction Ladder Code Ladder Code

More Related