Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Do-more Technical Training Instruction Set (Program-Looping)"— Presentation transcript:

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

2 Instruction Set THE BASICS ▫1▫181 instructions CContact (14) CCoil/Bit Output (11) AAnalog/Process (13) DDate/Time/Calendar (7) EEthernet (5) HHardware/Device (9) HHigh Speed/CTRIO (19) MMath (5) MMisc/Data Manipulation (23) PProgram Control (20) PProgram-Looping (8) PProtocol-Custom/ASCII (7) PProtocol-Standard (10) SString (14) TTimer/Counter/Drum (16)

3 THE BASICS ▫1▫181 instructions IIn-line (100) – n nn no flag EExecutes completely in-line on same scan FFully Asynchronous (48) – R RR Red DDependent on shared Device’s availability LLocks Device when executed to make it exclusive UUnlocks Device after it is finished MMust not terminate before it is finished MMust wait for Success or Error indication MMulti-scan (20) – Y YY Yellow TTakes 2 or more scans to complete or function properly DDepend on the status of the instruction from previous scan ((Edge-triggering inputs normally take 2 also) YYielding (5) – B BB Blue CCan temporarily postpone operation until next scan (NEXT, UNTIL, WEND) SSkipping (6) – G GG Green CCan skip forward or backward in code (BREAK, CONTINUE) YYielding/Skipping (2) - B BB Blue Green CCan temporarily postpone operation until next scan and skip forward or backward in code Box Instruction Corner

4 Instruction Set (Program-Looping) Program-Looping (8) ▫BREAK ▫CONTINUE NEXT ▫FOR/NEXT UNTIL ▫REPEAT/UNTIL WEND ▫WHILE/WEND

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

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

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

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

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

10 Instruction SetInstruction Set (Program-Looping)


Download ppt "Do-more Technical Training Instruction Set (Program-Looping)"

Similar presentations


Ads by Google