beautypg.com

Sample program, 2 instructions – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 94

background image

2 Instructions

2-58

CP1E CPU Unit Instructions Reference Manual(W483)

A jump instruction such as JMP(004) may be executed within a FOR-NEXT loop, but do not jump

beyond the FOR-NEXT loop.

The following instructions cannot be used within FOR-NEXT loops:

STEP DEFINE and STEP START: STEP(008)/SNXT(009)

Sample program

&3

Breaks FOR-NEXT loop 2.

Breaks FOR-NEXT loop 1.

Escapes from loop

when condition a

is ON.

Remaining

instructions are

processed as

NOP(000).

FOR

&3

BREAK

NEXT

a

FOR

&2

BREAK

NEXT

FOR

&3

BREAK

NEXT

2

1

#0000

D100

D0

D1

D2

D200

Repeated 3 times.

In the left example, the looped program section transfers
the content of D100 to the address indicated in D200
and then increments the content of D200 by 1.

FOR

&3

MOV

D100

@D200

++

D200

NEXT

MOV

#0000

This manual is related to the following products: