beautypg.com

Hitachi NJI-350B User Manual

Page 159

background image

Chapter 5 Instruction Specifications

5-109

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

Usable I/O

X

Y

R,

M

TD, SS,

CU, CT

WX WY

WR,

WM TC DX DY

DR,

DM

C

o

nstant

Other

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

Instruction for use

R000

CAL n

SB n

RTS

END

Other program

Subroutine program

R000 turns
ON

R000 turns
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.

CA

L n