23.06.2014 Views

5. Commands and Functions - Sanyo Denki America, Inc.

5. Commands and Functions - Sanyo Denki America, Inc.

5. Commands and Functions - Sanyo Denki America, Inc.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>5.</strong> <strong>Comm<strong>and</strong>s</strong> <strong>and</strong> <strong>Functions</strong><br />

Comm<strong>and</strong> Code: 106 (6Ah)<br />

Data Length: 2 bytes<br />

FOR (loop counter)<br />

DAT No Function Setting range Setting unit<br />

DAT1 Variable appointment O to A <br />

DAT2 Loop counter (repetition time) 1 to FFh <br />

This comm<strong>and</strong> repeats the program enclosed by a For <strong>and</strong> a Next (comm<strong>and</strong> 6Bh), using the same<br />

variable, as many times as specified by the loop counter <strong>and</strong> is used together with the Next comm<strong>and</strong>.<br />

* The loop counter increments by 1. The number of loop repetitions is specified by the loop counter.<br />

* Nested loops are allowed within the specified variable range.<br />

* The loop counter clears to 0 when the loop ends.<br />

Comm<strong>and</strong> Code: 107 (6Bh)<br />

Data Length: 1 byte<br />

NEXT (loop counter)<br />

DAT No Function Setting range Setting unit<br />

DAT1 Variable appointment O to A <br />

This comm<strong>and</strong> repeats the program enclosed by a For (comm<strong>and</strong> 6Ah) <strong>and</strong> a Next, using the same<br />

variable, as many times as specified by the loop counter, <strong>and</strong> is used together with the For comm<strong>and</strong>.<br />

* Must use the same variable as the For comm<strong>and</strong>.<br />

Comm<strong>and</strong> Code: 108 (6Ch)<br />

Data Length: 2 bytes<br />

Subroutine call<br />

DAT No Function Setting range Setting unit<br />

DAT12 Subroutine first line number O to A <br />

This comm<strong>and</strong> initiates a subroutine call. The target of the subroutine call is specified by the line<br />

number, <strong>and</strong> is used together with Return (comm<strong>and</strong> 6Dh).<br />

* Nested Gosub/Return comm<strong>and</strong>s are allowed up to 16 levels.<br />

Comm<strong>and</strong> Code: 109 (6Dh)<br />

Data Length: 0 bytes<br />

Return<br />

This comm<strong>and</strong> returns execution from the subroutine to the main program, <strong>and</strong> is used together with<br />

the Gosub comm<strong>and</strong>.<br />

* Nested Gosub/Return comm<strong>and</strong>s are allowed up to 16 levels.<br />

5-40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!