Set: set res: reset – KEYENCE Visual KV Series User Manual

Page 90

Advertising
background image

2.4 Instruction Details

3-66

2

Chapter 2 Instructions

Example

Coding

Description

Output relay 0500 remains ON after input relay 0000 turns OFF. Output relay
0500 turns OFF when input relay 0001 turns ON.

SET instruction sets a latch whereas RES instruction resets it.

RES instruction not only turns OFF relay coils but serves as a reset signal when
a timer or counter is used as an operand.

Note: The SET and RES instructions can be entered in any order. Note, however,
that priority is given to the instruction that is entered last.
In the above example, when both 0000 and 0001 are ON, RES has priority over
SET, causing 0500 to remain OFF.

Tips

Differences between SET/RES and KEEP

Basically , SET/RES and KEEP (

➮ See above and p. 3-80) serve the same purpose.

SET and RES can be used separately. Therefore, RES can be placed before
SET.
Another instruction may be placed between SET and RES.

KEEP needs only three lines of program, therefore saving memory space when
used a number of times.

Operands

Key operation

SET: Set

RES: Reset

Turns ON specified relay when input is ON
and enables this relay to remain ON.

Turns OFF specified relay, timer, or counter
when input is ON.

SET

1

RES

0

nnnn

RES

nnnn

SET

0000

0001

0500

SET

0500

RES

Line No.

Instruction

Operand

0000

LD

0000

0001

SET

0500

0002

LD

0001

0003

OUB

0500

0001

0002

0001

0002

C000

RES

#00100

00000

C000

#00100

0000

C000

0000

0001

0500

SET

0500

RES

0000

0001

RES

KEEP

0500

SET

LD

0000

RES

0500

LD

0001

SET

0500

LD

0000

LD

0001

KEEP 0500

SET

1

RES

0

Operand

ENT

R-SRCH

Operand

ENT

R-SRCH

:

:

SET / RES

Visual KV

KV-300

KV-10/16

KV-24/40/80

0500 to 1915

0500 to 1915

0500 to 1915

0500 to 1915

2009

2009

2009

2009

2100 to 17915

2100 to 17915

2100 to 2915

2100 to 6915

T000 to T249

T000 to T249

T000 to T063

T000 to T119

C000 to C249

C000 to C249

C000 to C063

C000 to C119

CTH0 to CTH1 (RES only)
CTC0 to CTC3 (RES only)

KVNKA Chap 02_4aP.p65

08.3.11, 11:57 AM

66

Advertising