beautypg.com

Hitachi NJI-350B User Manual

Page 160

background image

Chapter 5 Instruction Specifications

5-110

Item number

Control instructions-9

Name

Start subroutine program

Ladder format

Condition code

Processing time (

µs)

Remark

R7F4

R7F3

R7F2

R7F1

R7F0

Average Maximum

SB n

DER

ERR

SD

V

C

z

1]

z

z

z

Instruction format

Number of steps

0.5

Condition

Steps

SB n

1

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

• This instruction indicates the start of a subroutine program (processing is not performed).
• The n in the SB n cannot be used more than once in the same program.
• Even if a startup condition is used for SB n, it will be ignored.
• Always use SB n and RTS in pairs.
• Code the SB n to RTS subroutine program after the END 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

34

WRF001

H0004

Duplicate definition of SB

H0013

SB undefined

Instruction for use

END

SB 0

SB 1

RTS

SB 0 SB 1

Subroutine 0.1 program

Subroutine 0 program

• When CAL 0 is executed, SB 0 to RTS is executed as a subroutine.
• When CAL 1 is executed, SB 1 to RTS is executed as a subroutine.

SB
n