Chapter 5 Instruction Specifications

Item number

 

Control instructions-7

 

 

Name

 

 

NEXT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

 

 

 

Condition code

 

Processing time (s)

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

 

R7F3

 

R7F2

 

R7F1

R7F0

Average

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NEXT n

 

 

DER

 

ERR

 

SD

 

 

V

 

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

z

1]

 

 

z

 

 

z

 

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction format

 

 

 

 

 

 

Number of steps

 

38

 

 

 

 

 

 

 

 

 

 

 

Condition

 

 

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NEXT 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 49 (Decimal)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• Subtracts 1 from the number of times repeated (s) for the FORn (s) instruction of the same code number, then jumps to FORn (s).

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

H0003

Duplicate definition of NEXT

 

 

 

 

• 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

H0016

FOR undefined

 

 

 

 

 

 

H0046

FOR nesting overflow

 

 

 

 

NEXT n

Instruction for use

R000 DIF0

 

WR0000 = 512

 

 

 

 

 

WR0001 = 0

When

FOR 0(WR0000)

WR0000 > 0

TC0(WR0001) = 0

 

 

 

 

 

 

 

 

 

 

WR0001 = WR0001 + 1

 

 

 

 

 

NEXT 0

When

 

 

WR0000 = 0

To the next program

 

 

 

 

 

 

 

 

 

 

 

When R000 is turned on, the progress value (TC n) of the timer or counter is cleared with 0 for 512 points.

Once the FOR to NEXT starts, the instruction keeps executing until (s) is “0.”

FOR0 (WR0000) performs instructions after TC0 (WR0001) = 0 while WR0000>0, subtracts “1” from WR0000 at NEXT0, then jumps to FOR0 (WR0000).

FOR0 (WR0000) jumps to the next instruction within the current box upon WR0000 = 0.

5-107

Page 157
Image 157
Hitachi NJI-350B manual Control instructions-7, Next, 107