Chapter 5 Instruction Specifications

Item number

 

Control instructions-10

 

 

Name

 

 

End of subroutine program (RETURN SUBROUTINE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

 

Condition code

 

Processing time (s)

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

 

R7F3

 

R7F2

 

R7F1

R7F0

Average

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RTS

 

 

 

DER

 

ERR

 

SD

 

 

V

 

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

z

 

 

z

 

 

z

 

 

z

 

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction format

 

 

 

 

Number of steps

 

25

 

 

 

 

 

 

 

 

 

 

Condition

 

 

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RTS

 

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

 

 

 

Word

 

Double word

 

Constant

 

 

 

Usable I/O

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Other

 

 

X

Y

M

 

 

CU, CT

 

WX

WY

WM

 

TC

DX

DY

DM

 

 

 

 

 

 

 

 

 

R,

 

TD, SS,

 

 

 

 

 

WR,

 

 

 

 

DR,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Function

• This instruction declares the end of a subroutine program.

• When this instruction is executed, the program is resumed starting from the line following the CAL n instruction that called the subroutine.

• Do not set a startup condition with this instruction.

Notes

This instruction is checked prior to execution, and when there is an error, the following error code is set in the special internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.

CPU error code

Special internal output

Error code

Error description

 

 

 

 

 

 

H0011

SB undefined

 

 

 

 

34

WRF001

H0020

SB area error

 

 

 

 

 

 

H0030

RTS startup condition error

 

 

 

 

RTS

Instruction for use

R000

CAL 0

END

Subroutine 0 SB 0 R001 program

CAL 1

Subroutine 0 program

RTS

SB 1

Subroutine 1 program

RTS

1] 2] 3]

1]

The program is executed when R000 and R001 are both off

 

 

 

 

2]

The program is executed when R000 is on and R001 is off

 

 

 

 

 

CAL 0 is executed, then the subroutine 0 program is executed.

 

 

 

 

 

 

 

 

 

 

CAL 1 is not executed, the subroutine 0 program is terminated and the

 

 

 

 

 

execution is returned to the code following the CAL 0.

 

 

 

 

3]

The program is executed when R000 and R001 are both on

 

 

 

 

 

 

 

 

 

CAL 0 is executed, then the subroutine 0 program is executed.

 

 

 

 

 

CAL 1 is executed, then the subroutine 1 program is executed.

 

 

 

 

 

 

 

 

 

 

The subroutine 1 program is completed and execution is returned to the code

 

 

 

 

 

following the CAL 1.

 

 

 

 

 

 

 

 

 

 

The subroutine 0 program is completed and execution is returned to the code

 

 

 

 

 

 

 

 

 

 

following the CAL 0.

5-111

Page 161
Image 161
Hitachi NJI-350B manual Rts Der Err, 111