6F3B0250

7. Instructions

FUN 128

CALL

Subroutine call

Expression

Input -[ CALL N. n ]- Output

Function

When the input is ON, this instruction calls the subroutine number n.

Execution condition

Input

 

Operation

Output

OFF

No execution

 

OFF

ON

Execution

 

ON

Operand

 

Name

 

 

Device

 

 

 

 

 

 

Register

 

 

Constant

Index

 

 

X

Y

R

S

T.

C.

XW

YW

RW

SW

T

C

D

I

J

K

 

 

n

Subroutine

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ö (Note)

 

 

number

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example

When X007 is ON, the subroutine number 8 is called. When the program execution is returned from the subroutine, the output is turned ON.

Main program

Subroutine

[ CALL N.008 ]

Note

[ SUBR (008)]

[ RET ]

·The possible subroutine number is 0 to 15 (T1) or 0 to 255 (T1S).

·Refer to the SUBR instruction (FUN 137).

·In case of T1, nesting of subroutines is not allowed. That is, the CALL instruction cannot be used in a subroutine.

·In case of T1S, nesting of subroutines is possible. (up to 3 levels)

·The CALL instruction can be used in an interrupt program. However, it is not allowed that the same subroutine is called from an interrupt program and from main program.

Basic Hardware and Function 221

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

Page 223
Image 223
Toshiba 6F3B0250, PROSEC T1 T1S user manual Call, Subroutine call