Chapter 5 Instruction Specifications

Item number

 

Control instructions-8

 

 

Name

 

 

Call subroutine

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

 

Condition code

 

Processing time (s)

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

 

R7F3

 

R7F2

 

R7F1

R7F0

Average

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CAL n

 

 

 

 

DER

 

ERR

 

SD

 

 

V

 

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

z

1]

 

 

z

 

 

z

 

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction format

 

 

 

 

Number of steps

 

24

 

 

 

 

 

 

 

 

 

 

 

Condition

 

 

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CAL n

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

 

 

 

Word

 

Double word

 

Constant

 

 

 

Usable I/O

 

 

X

Y

M

 

 

CU, CT

 

WX

WY

WM

 

TC

DX

DY

DM

 

 

Other

 

 

 

 

 

 

 

 

R,

 

TD, SS,

 

 

 

 

 

WR,

 

 

 

 

DR,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

n

Code number

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

{

 

0 to 99 (Decimal)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• If the startup condition of CAL n is on, this instructions executes the subroutine program (the program sandwiched by SB n and RTS) of the same code number.

• If the startup condition is off, the next program is executed.

• Up to 5 levels of CAL (nesting) for another subroutine can be performed within a subroutine.

• It is possible to call a subroutine from within an interrupt scan program.

Notes

• If an error is generated during the execution of the instruction, an error code will be set in the special internal outputs R7F3 and WRF015, and the following program will be executed.

Special internal output

Error code

Error description

 

 

 

 

R7F3=1

WRF015

H0013

SB undefined

 

 

 

 

 

 

H0041

Nesting error

 

 

 

 

CAL n

Instruction for use

R000

CAL n

Other program

END

SB n

Subroutine program

R000 turns

R000 turns

ON

OFF

When R000 is on, a subroutine program is executed by CAL n. After the execution, the program is re-executed from the code following the CAL n.

When R000 is off, the subroutine program is not executed, and the next program is executed.

RTS

5-109

Page 159
Image 159
Hitachi NJI-350B manual 109