KEYENCE Visual KV Series User Manual

Page 146

Advertising
background image

2.4 Instruction Details

3-122

2

Chapter 2 Instructions

Example

Coding

Description

•

When input relay 0000 turns ON, the subroutine specified by SBN00 and RET is
executed. When the subroutine ends, instructions following CALL are executed.

•

When the input relay is ON, the CALL instruction executes the subroutine speci-
fied by the operand.

•

A subroutine program must be defined between the SBN and RET instructions.

•

A subroutine must be defined between END and ENDH instructions.

•

Once a CALL instruction has been encountered, program execution transfers to
the subroutine specified by the SBN and RET instructions. Once a RET instruc-
tion has been encountered, program execution returns to the instruction immedi-
ately following the CALL instruction.

Operand

Key operations

CALL: Subroutine Call

SBN: Subroutine Entry

RET: Subroutine Return

Executes subroutine specified by operand.

Represents beginning of subroutine speci-
fied by operand.

Represents end of subroutine.

RES

0

RES

0

AND

8

ORL

3

ORL

3

ORL

3

FUN

FUN

FUN

RET

SBN
nn

CALL

nn

Line No.

Instruction

Operand

0000

:

:

:

:

:

:

LD

0000

:

CALL

00

:

:

:

:

END

:

:

SBN

00

:

:

:

:

RET

:

:

ENDH

:

0000

00

CALL

END

SBN

00

RET

ENDH

RES

0

AND

8

ORL

3

ORL

3

ORL

3

ORL

3

FUN

FUN

FUN

Operand

ENT

R-SRCH

ENT

R-SRCH

ENT

R-SRCH

ENT

R-SRCH

:

:

:

CALL / SBN / RET

CALL

00 to 99

SBN

00 to 99

RET

—

KVNKA Chap 02_4bP.p65

08.3.11, 0:00 PM

122

Advertising