03.01.2013 Views

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.6.5 Subroutines<br />

6F3B0253<br />

6. Programming Information<br />

In the program type ‘Subroutine’, The following number of subroutines can be<br />

programmed.<br />

The <strong>T1</strong>-<strong>16S</strong> supports up to 256 subroutines.<br />

The subroutine is not a independent program. It is called from other program types<br />

(main program, sub-program, interrupt program) and from other subroutines.<br />

One subroutine is started with the SUBR instruction, and ended by the RET<br />

instruction.<br />

It is necessary to assign a subroutine number to the SUBR instruction. The available<br />

subroutine numbers are 0 to 255.<br />

⎯[ SUBR (000) ]⎯<br />

Subroutine number<br />

The RET instruction has no subroutine number.<br />

The instruction that calls a registered subroutine is the CALL instruction. The CALL<br />

instruction has the subroutine number to be called.<br />

⎯[ CALL N.000 ]⎯<br />

Subroutine number<br />

Main program<br />

Execution<br />

Subroutine<br />

flow<br />

⎥⎯[ SUBR (000) ]⎯⎯⎯⎜<br />

⎥⎯⎜⎥⎯[ CALL N.000 ]⎯⎯⎜<br />

NOTE<br />

⎥⎯⎯⎯⎯⎯⎯ [ RET ]⎯⎜<br />

(1) Multiple subroutines can be programmed in a block. However, one<br />

subroutine in one block is recommended.<br />

(2) From the inside of a subroutine, other subroutines can be called<br />

(nesting). Its allowable level is up to 3 levels.<br />

Basic Hardware and Function 97<br />

<strong>CTi</strong> <strong>Automation</strong> - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net

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

Saved successfully!

Ooh no, something went wrong!