Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 9 of 9

User's Manual Visual KV Series 3 Programming, pages 71 to 79

Pages 71 to 79 of 79

The original document is the PDF (355 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

Filed in the catalog under the Keyence KV-16R

Page 71

2.2 Instruction List

KV-300 Series, KV-10/80

KV-300 Instruction Symbol

16-BIT COUNTER COMPARATOR

#ddddd CTCn

16-BIT COUNTER

CTH1 nnnn

Mnemonic Operand

CTC n: Comparator No. ddddd: # preset value n: 0, 1 ddddd: #00000 to #65535

CTH

Clock source Rs

0005 2200 2201 2202

CTC n: Comparator No. ddddd: # preset value

16-bit (0 to 65535) up4 (7) counter for clock pulses with input response frequency of 30 kHz.

n: 2, 3 ddddd: #00000 to #65535, Hardware-based comparator between preset & current 2 (0) values of high speed counter. 3-204 This comparator is turned ON when these values are equal.

CALL Subroutine [FNC 03] No.

00 to 99

3.16

2 (17) Executes subroutine specified by operand.

3-122

00 to 99, Represents beginning of 2 (0) subroutine specified by operand.

3-122

Represents end of subroutine.

3-122

1.55

Executes program between 3 (19) FOR & NEXT for number of times specified by operand.

3-125, 1 (0) Represents end of repetition. 3-125 nn CALL

SUBROUTINE ENTRY

SBN nn

SBN [FNC 38]

RET

RET [FNC 33]

REPEAT START

FOR nnnn

FOR [FNC 16]

REPEAT END

NEXT

NEXT [FNC 29] nnnn mmmm

Page

3.85

SUBROUTINE CALL

HKEY

Function, #ddddd CTCn

16-KEY INPUT

Exec.time Bytes (µs)

Hardware-based comparator between preset & current 2 (0) values of high speed counter. 3-204 This comparator is turned ON when these values are equal.

16-BIT COUNTER COMPARATOR

SUBROUTINE RETURN

Operand value

HKEY [FNC 17]

Subroutine No.

1.15 to 1.45 # constant, DM No.

I/O R

#00000 to #65535 DM0000 to DM9999 TM00 to TM29 nnnn:0000 to 0009 10000 to 10415 : 17000 to 17415 mmmm:0500 to 0503 10500 to 10915 : 17500 to 17915

16.50

1 (6)

Reads 16-key data by time5 (9) sharing and outputs these data into special utility Rs 2900 to 2915.

Chapter 2 Instructions

3-204

3-131

3-47

12

Page 72

2.2 Instruction List

KV-300 KV-300 Series, Series, KV-10/80

2.2.3 Arithmetic Instructions KV-10/16/24/40/80 Instruction

DATA MEMORY WRITE

Symbol nnnn

< DW > DMmmmm n

TRIMMER SETTING

< TMIN >

TMIN [FNC 50]

@TMIN ↑ TMIN > @[FNC 50]

Trimmer No.

n nnnn

< LDA >

LOAD A nnnn

↑ LDA >

2

KV-10/16/24/40/80 Mnemonic Operand Operand value Operand value Exec.time Function Bytes KV-10/16 (µs) KV-24/40/80 #00000 to #0000 to #65535 #65535 #/$ $0000 to $0000 to 3.6 to 6.0 5 (6) Writes constant into constant, DW data memory. $FFFF $FFFF DM No. DM0000 to DM0000 to DM0999 DM1999 nnnn

< STA >

STORE A nnnn

↑ STA > nnnn

< CMP >

COMPARE nnnn

↑ CMP > nnnn

< ADD >

ADD nnnn

↑ ADD > nnnn

< SUB >

SUBTRACT nnnn

↑ SUB > nnnn

< MUL >

MULTIPLY nnnn

↑ MUL > nnnn

< DIV >

DIVIDE nnnn

↑ DIV >

0

0 to 1

13.0 to 15.0 1 (4) Converts trimmer rotation angle into 0 to 249 and inputs it 25.0 to 29.0 1 (11) into internal register.

0000 to 2915 0000 to 6915 T000 to T063 T000 to T119 C000 to C063 C000 to C119 LDA 3 (5) R No., CTH0 to CTH1 CTH0 to CTH1 10.0 to 46.0 [FNC 23] C/T No., Inputs value specified DM0000 to DM0000 to DM/TM DM0999 DM1999 by operand into No., TM00 to TM31 TM00 to TM31 internal register or #/$ #00000 to #00000 to inputs current value constant, #65535 #65535 when T/C is specified 3 (12) @LDA 22.0 to 60.0 $0000 to $0000 to #TMxx as operand. @[FNC 23] $FFFF $FFFF #TM00 to #TM00 to #TM29 #TM29 0500 to 1915 0500 to 1915 R No., 2100 to 2915 2100 to 6915 9.0 to 99.0 STA 3 (5) Transfers content of internal register to [FNC 42] C/T No., T000 to T063 T000 to T119 DM/TM C000 to C063 C000 to C119 location specified by No., DM0000 to DM0000 to operand, or changes #/$ DM1999 DM0999 preset value when T/ @STA constant, TM00 to TM29 TM00 to TM29 21.0 to 113.0 3 (12) C is specified as @[FNC 42] #TMxx #TM00 to #TM00 to operand. #TM29 #TM29

Page

3-136

3-138

3-140

3-140

CMP [FNC 04]

DM0000 to 14.0 to 68.0 3 (5) Compares content of DM0000 to internal register and DM1999 DM0999 value specified by DM/TM TM00 to TM31 TM00 to TM31 @CMP 26.0 to 82.0 3 (12) operand. #00000 to #00000 to No., @[FNC 04] #65535 #65535 #/$ $0000 to $0000 to Adds content of constant, ADD 3 (5) internal register and $FFFF $FFFF 13.0 to 65.0 #TMxx [FNC 00] #TM00 to #TM00 to value specified by #TM29 #TM29 operand and inputs @ADD 25.0 to 79.0 3 (12) result back to same @[FNC 00] register. Subtracts value SUB 15.0 to 68.0 3 (5) specified by operand [FNC 46] from content of register and inputs @SUB DM0000 to DM0000 to 27.0 to 82.0 3 (12) result back to same @[FNC 46] register. DM0999 DM1999 TM00 to TM31 TM00 to TM31 Multiplies content of MUL #00000 to #00000 to 17.0 to 71.0 3 (5) internal register by [FNC 28] DM/TM #65535 #65535 value specified by No., $0000 to $0000 to operand and inputs #/$ No., @MUL $FFFF $FFFF 29.0 to 85.0 3 (12) result back to same @[FNC 28] #TMxx #TM00 to #TM00 to register. #TM29 #TM29 Divides content of DIV 22.0 to 79.0 3 (5) internal register by [FNC 11] value specified by operand and inputs @DIV 34.0 to 93.0 3 (12) result back to same @[FNC 11] register.

3-48 Chapter 2 Instructions

3-146

3-150

3-150

3-150

3-150

Page 73

2.2 Instruction List

Instruction

Symbol

EXCLUSIVE-ORs each of 16 bits of internal register and 3-164 that of value specified by operand, and inputs result back to same register.

nnnn

< ORA >

OR A nnnn

↑ ORA >

ANDA [FNC 01] nnnn

EORA [FNC 15]

#dd

< SRA >

SRA [FNC 41]

#dd

@SRA @[FNC 41]

Moves content of internal register serially right by value specified by 23.0 to 42.0 2 (11) operand.

#dd

SLA [FNC 40]

10.0 to 28.0 2 (4)

↑ SRA >

< SLA > #dd

@SLA @[FNC 40]

#dd

RRA [FNC 37]

↑ SLA >

11.0 to 28.0 2 (4)

< RRA > #dd

@RRA @[FNC 37]

#dd

RLA [FNC 35]

↑ RRA >

< RLA >

ROTATE LEFT A

COM [FNC 05]

5.0 to 6.0

↑ COM >

@COM @[FNC 05]

17.0 to 20.0 1 (10)

INC [FNC 19]

12.0 to 15.0 3 (5)

nnnn

DECREMENT MEMORY nnnn

↑ INC > nnnn

< DEC > nnnn

↑ DEC > #n

MULTIPLEXER

Moves content of internal register serially right, allowing each bit 3-169 that leaves right end to 24.0 to 44.0 2 (11) enter carry bit and then leftmost bit. Moves content of 12.0 to 29.0 2 (4) internal register serially left, allowing each bit 3-169 that leaves left end to 24.0 to 43.0 2 (11) enter carry bit and then rightmost bit.

< COM >

< INC >

< MPX >

DM/TM No.

↑ MPX >

Inverts content of each bit in internal register.

3-171

DM0000 to DM0000 to DM0999 DM1999TM00 TM00 to TM29 to TM29 14.0 to 17.0 3 (5)

@DEC @[FNC 07]

Subtracts 1 from content of data memory specified by 26.0 to 31.0 3 (12) operand.

MPX [FNC 27]

24.0 to 25.0 1 (4) # constant

#n

1 (3)

Adds 1 to content of data memory 3-172 24.0 to 29.0 3 (12) specified by operand.

@INC @[FNC 19] DEC [FNC 07]

12

12.0 to 30.0 2 (4)

@RLA @[FNC 35]

COMPLEMENT

INCREMENT MEMORY

#01 to #16

↑ RLA >

#dd

3-166

Moves content of internal register 3-166 serially left by value 22.0 to 42.0 2 (11) specified by operand.

# constant ROTATE RIGHT A

Page

0000 to 2915 0000 to 6915 DM0000 to DM0000 to 10.0 to 63.0 3 (5) <EORA> DM0999 DM1999 R No., TM00 to TM31 TM00 to TM31 DM/TM No., #00000 to #00000 to #/$ No., #65535 #65535 #TMxx $0000 to $0000 to @EORA nnnn $FFFF $FFFF 22.0 to 77.0 3 (12) ↑EORA> @[FNC 15] #TM00 to #TM00 to #TM29 #TM29 nnnn

↑ANDA>

SHIFT LEFT A

Function

ANDs each of 16 bits of internal register and that of value specified 3-159 by operand, and inputs result back to same register. ORs each of 16 bits of internal register and that of value specified 3-161 by operand, and inputs result back to same register.

AND A

SHIFT RIGHT A

KV-10/16/24/40/80 Operand value Operand value Exec.time Bytes KV-10/16 (µs) KV-24/40/80

0000 to 2915 0000 to 6915 11.0 to 64.0 3 (5) DM0000 to DM0000 to DM0999 DM1999 @ANDA TM00 to TM31 TM00 to TM31 23.0 to 78.0 3 (12) R No., @[FNC 01] #00000 to DM/TM No., #00000 to #65535 #/$ No., #65535 ORA $0000 to #TMxx $0000 to 11.0 to 63.0 3 (5) [FNC 31] $FFFF $FFFF #TM00 to #TM00 to @ORA #TM29 #TM29 23.0 to 77.0 3 (12) @[FNC 31] nnnn

<ANDA>

EXCLUSIVE OR A

Mnemonic Operand

KV-300 Series, KV-10/80

@MPX @[FNC 27]

#0 to #3

Converts 4-bit data (specified by operand) of internal 36.0 to 39.0 1 (11) register into 16bit data.

Chapter 2 Instructions

3-172

3-176

3-49

Page 74

2.2 Instruction List

Instruction

Symbol

KV-10/16/24/40/80 Operand value Mnemonic Operand Operand value Exec.time Bytes KV-10/16 (µs) KV-24/40/80

< DMX >

DMX [FNC 12]

↑ DMX >

@DMX @[FNC 12]

<TBCD>

TBCD [FNC 47]

↑ TBCD>

3-180

@TBCD @[FNC 47]

< TBIN >

TBIN [FNC 48]

18.0 to 20.0 1 (3)

↑ TBIN>

@TBIN @[FNC 48]

< ASC >

ASC [FNC 02]

↑ ASC >

@ASC @[FNC 02]

<RASC>

RASC [FNC 32]

19.0 to 21.0 1 (3)

Converts content of internal register (4digit BCD) into 16-bit 30.0 to 34.0 1 (10) binary data. 8.0

12.0 to 14.0

3-180

1 (3)

Converts content of lower order byte of internal register into 20.0 to 22.0 1 (10) 2-digit ASCII code.

@RASC ↑ RASC> @[FNC 32]

3-183

1 (3)

Converts 2-digit ASCII code into one byte data. 24.0 to 28.0 1 (10)

3-183

Takes square root of 32bit data (TM00: higher order byte, internal register: lower order 1 (10) byte) and inputs result back to same register.

3-185

ROOT [FNC 36]

102.0 to 103.0

@ROOT ↑ ROOT> @[FNC 36]

114.0 to 117.0

<ROOT>

SQUARE ROOT

28.0 to 30.0 1 (3)

Converts content of internal register (16bit binary) into 4-digit 31.0 to 35.0 1 (10) BCD data.

ASCII CONVERT

2

Page

3-176

TRANSFER BIN

REVERSE ASCII CONVERT

Function

Converts position of highest order bit with 1 in internal register 40.0 to 44.0 1 (10) into 4-bit data.

DEMULTIPLEXER

TRANSFER BCD

KV-300 KV-300 Series, Series, KV-10/80

1 (3)

KV-300 KV-300 Instruction

Symbol

DATA MEMORY WRITE nnnn

< DW > DMmmmm n

TRIMMER SETTING

< TMIN >

Mnemonic Operand

DW

@TMIN ↑ TMIN > @[FNC 50]

< LDA >

LOAD A nnnn

↑ LDA > nnnn

< STA >

STORE A nnnn

↑ STA > nnnn: #0000 to #65535 $0000 to $FFFF DMmmmm: DM0000 to DM9999

TMIN [FNC 50] n nnnn

#/$ constant, DM No.

Operand value

Trimmer No.

LDA [FNC 23] R No., C/T No., DM/TM No., #/$ @LDA @[FNC 23] constant, #TMxx

STA [FNC 42]

R No., C/T No., DM/TM No., #/$ @STA constant, @[FNC 42] #TMxx

3-50 Chapter 2 Instructions

0, 1

Exec.time Bytes (µs)

0500 to 1915 2100 to 17915 T000 to T249 C000 to C249 CTC0 to CTC3 DM0000 to DM9999 TM00 to TM29 #TM00 to #TM29

Page

0.60 to 1.40

5 (11) Writes constant into data memory.

3-136

5.10 to 5.60

1 (11) Converts trimmer rotation angle into 0 to 249 and inputs it into 1 (25) internal register.

3-138

2.00 to 5.70 0000 to 0009 0500 to 17915 T000 to T249 C000 to C249 CTH0 to CTH1 DM0000 to DM9999 TM00 to TM31 #00000 to #65535 $0000 to $FFFF #TM00 to #TM29

Function

0.30 to 28.00

3 (12)

2.30 to 30.00

3 (26)

0.20 to 30.00

3 (12) Transfers content of internal register to location specified by 3-140 operand, or changes preset value when T/C 3 (26) is specified as operand.

2.20 to 32.00

Inputs value specified by operand into internal register or inputs 3-140 current value when T/C is specified as operand.

Page 75

2.2 Instruction List

KV-300 Series, KV-10/80

KV-300 Instruction

Symbol nnnn

< CMP >

Mnemonic Operand

Operand value

Exec.time Bytes (µs) 9.20 to 36.00

CMP [FNC 04]

COMPARE nnnn

↑ CMP > nnnn

< ADD >

@CMP @[FNC 04] ADD [FNC 00]

ADD

DM/TM No., #/$ constant, #TMxx

DM0000 to DM9999 TM00 to TM31 #00000 to #65535 $0000 to $FFFF #TM00 to #TM29

11.20 to 38.00 7.70 to 35.00 9.70 to 37.00 nnnn

SUB [FNC 46]

8.40 to 35.00 nnnn

@SUB @[FNC 46]

10.40 to 37.00 nnnn

MUL [FNC 28]

SUBTRACT ↑ SUB >

< MUL >

MULTIPLY

DM/TM No., #/$ No., #TMxx

DM0000 to DM9999 TM00 to TM31 #00000 to #65535 $0000 to $FFFF #TM00 to #TM29

9.80 to 37.00 nnnn

@MUL @[FNC 28] nnnn

DIV [FNC 11]

13.70 to 41.00 nnnn

@DIV @[FNC 11]

15.70 to 42.00 nnnn

ANDA [FNC 01]

6.90 to 33.00

↑ MUL >

< DIV >

11.80 to 39.00

DIVIDE ↑ DIV >

<ANDA>

AND A nnnn

@ANDA @[FNC 01] nnnn

< ORA >

ORA [FNC 31] nnnn

@ORA @[FNC 31]

↑ANDA>

OR A ↑ ORA >

R No., DM/TM No., #/$ No., nnnn @EORA ↑EORA> @[FNC 15] #TMxx nnnn

EXCLUSIVE OR A

EORA [FNC 15]

R No., DM/TM No., #/$ No., #TMxx

<EORA>

0000 to 0009 0500 to 17915 DM0000 to DM9999 TM00 to TM31 #00000 to #65535 $0000 to $FFFF #TM00 to #TM29

8.90 to 35.00 6.90 to 33.00 8.90 to 35.00

0000 to 0009 0500 to 17915 DM0000 to DM9999TM00 to TM31 #00000 to #65535 $0000 to $FFFF #TM00 to #TM29

6.90 to 33.00 8.9 to 35.00

3 (12) Compares content of internal register and value specified by 3 (26) operand.

3-146

Adds content of internal register and value 3-150 specified by operand 3 (26) and inputs result back to same register.

@ADD @[FNC 00]

< SUB >

Page

3 (12)

nnnn

↑ ADD >

Function

Subtracts value 3 (12) specified by operand from content of register and inputs result back 3 (26) to same register.

3-150

Multiplies content of 3 (12) internal register by value specified by operand and inputs 3 (26) result back to same register.

3-150

Divides content of 3 (12) internal register by value specified by 3-150 operand and inputs 3 (26) result back to same register. ANDs each of 16 bits of 3 (12) internal register and that of value specified by 3-159 operand, and inputs 3 (26) result back to same register. ORs each of 16 bits of 3 (12) internal register and that of value specified by operand, and inputs 3-161 3 (26) result back to same register. EXCLUSIVE-ORs each 3 (12) of 16 bits of internal register and that of value 3-164 specified by operand, 3 (26) and inputs result back to same register.

Chapter 2 Instructions

3-51

12

Page 76

2.2 Instruction List

KV-300 KV-300 Series, Series, KV-10/80 KV-300

Instruction Symbol

#dd

@SRA @[FNC 41]

12.80

#dd

SLA [FNC 40]

10.80

< SLA > #dd

↑ SLA >

10.80

@SLA @[FNC 40]

12.80 # constant

12.00

@RRA @[FNC 37]

14.00

RLA [FNC 35]

12.00

↑ RLA >

@RLA @[FNC 35]

14.00

< COM >

COM [FNC 05]

6.10

#dd

↑ RRA > #dd

< RLA >

ROTATE LEFT A

#dd

COMPLEMENT ↑ COM >

2 nnnn

< INC >

INCREMENT MEMORY nnnn

↑ INC > nnnn

DECREMENT MEMORY

< DEC >

Moves content of 2 (11) internal register serially left, allowing each bit that leaves left end to 2 (25) enter carry bit and then rightmost bit.

3-169

1 (9)

7.70

3 (12)

@INC @[FNC 19]

9.70

3 (26)

7.70

3 (12)

@DEC @[FNC 07]

9.70

#n

MPX [FNC 27]

7.30

Inverts content of each bit in internal register.

3-171

Adds 1 to content of data memory specified by operand.

3-172

Subtracts 1 from content of data memory 3-172 3 (26) specified by operand.

↑ MPX >

@MPX @[FNC 27]

9.30

1 (11) Converts 4-bit data (specified by operand) of internal register into 1 (25) 16- bit data.

< DMX >

DMX [FNC 12]

6.70

1 (9)

↑ DMX >

@DMX @[FNC 12]

< MPX >

DEMULTIPLEXER

3-169

INC [FNC 19]

DM0000 to DM9999 TM00 to TM29

# constant #n

3-52 Chapter 2 Instructions

#0 to #3

8.70

3-166

Moves content of 2 (11) internal register serially right, allowing each bit that leaves right end to 2 (25) enter carry bit and then leftmost bit.

1 (23)

DM/TM No.

Page

2 (11) Moves content of internal register serially left by value specified by 3-166 2 (25) operand.

8.10

DEC [FNC 07]

Function

2 (22) Moves content of internal register serially right by value specified 2 (25) by operand.

@COM @[FNC 05] nnnn

↑ DEC >

MULTIPLEXER

#01 to #16

RRA [FNC 37]

#dd

< RRA >

ROTATE RIGHT A

Exec.time Bytes (µs)

SRA [FNC 41]

↑ SRA >

SHIFT LEFT A

Operand value

< SRA >

#dd

SHIFT RIGHT A

Mnemonic Operand

Converts position of highest order bit with 1 in internal register into 1 (23) 4-bit data.

3-176

3-176

Page 77

2.2 Instruction List

KV-300 Series, KV-10/80

KV-300 Instruction

TRANSFER BCD

Mnemonic

<TBCD>

TBCD [FNC 47]

13.20

@TBCD ↑ TBCD> @[FNC 47]

15.20

< TBIN >

TBIN [FNC 48]

14.00

↑ TBIN>

@TBIN @[FNC 48]

< ASC >

Function

Page

3-180

3-180

16.00

Converts content of internal register (4-digit BCD) into 16-bit binary 1 (23) data.

ASC [FNC 02]

8.50

1 (9)

↑ ASC >

@ASC @[FNC 02]

10.50

Converts content of lower order byte of internal register into 21 (23) digit ASCII code.

<RASC>

RASC [FNC 32]

6.80

1 (9)

ASCII CONVERT

@RASC

8.80

ROOT [FNC 36]

77.70

@ROOT

79.70

↑ ROOT> @[FNC 36]

1 (9)

1 (9)

3-183

Converts 2-digit ASCII code into one byte data. 3-183

↑ RASC> @[FNC 32]

<ROOT>

SQUARE ROOT

Operand value

Converts content of internal register (16-bit binary) into 4-digit BCD 1 (23) data.

TRANSFER BIN

REVERSE ASCII CONVERT

Operand

Exec.time Bytes (µs)

Symbol

1 (23) Takes square root of 32bit data (TM00: higher order byte, internal 3-185 register: lower order 1 (23) byte) and inputs result back to same register. 1 (9)

Chapter 2 Instructions

3-53

12

Page 78

2.2 Instruction List

KV-300 KV-300 Series, Series, KV-10/80

2.2.4 Interrupt Instructions KV-10/16/24/40/80 Symbol

Mnemonic Operand

INTERRUPT DISABLED

< DI >

DI [FNC 08]

3.0 to 4.6

INTERRUPT ENABLED

< EI >

EI [FNC 13]

3.0 to 4.6

INT nnn

R No.

RETURN INTERRUPT

RETI

Page

1 (4)

Disables execution of interrupt.

3-193

1 (4)

Enables execution of interrupt.

3-193

1 (8) Comparator No.

INT CTCn

Function

35.0 to 48.0

000 to 003

INT [FNC 20]

INTERRUPT

2

KV-10/16/24/40/80 Operand value Operand value Exec.time Bytes KV-10/16 (µs) KV-24/40/80

Instruction

Used with comparators CTC0 to CTC3 3-192 and executes instructions between INT and RETI.

35.0 to 48.8

CTC0 to CTC3

RETI [FNC 34]

20.0 to 23.0

Executes instructions between INT and RETI at rising edge of any of input 3-192 000 to 003 or at falling edge of 003.

1 (3)

Represents end of interrupt.

3-192

Function

Page

KV-300 KV-300 Exec.time Bytes (µs)

Instruction

Symbol

Mnemonic Operand

INTERRUPT DISABLED

< DI >

DI [FNC 08]

3.20

1 (9)

Disables execution of interrupt.

3-193

INTERRUPT ENABLED

< EI >

EI [FNC 13]

5.80

1 (0)

Enables execution of interrupt.

3-193

Executes instructions between INT and RETI at rising edge 3-192 of any of input 000 to 003 or at falling edge of 003.

INT nnn

R No.

000 to 003

40.00 to 80.00

1 (0)

CTC0 to CTC3

40.00 to 80.00

1 (0)

60 to 100

1 (0)

INT [FNC 20]

INTERRUPT INT CTCn

RETURN INTERRUPT

Operand value

RETI

Comparator No.

RETI [FNC 34]

3-54 Chapter 2 Instructions

Used with comparators CTC0 to CTC3 3-192 and executes instructions between INT and RETI. Represents end of interrupt.

3-192

Page 79

2.3 Convention Details

2.3 Convention Details In this chapter, each instruction is described as follows:

Instruction Describes the name and brief function of the instruction.

Ladder symbol Represents the form of the instruction on a ladder diagram.

Instruction key Represents the key or function No. for entry.

SET / RES

2.4 Instruction Details

SET: Set

Mnemonic Represents the instruction in ladder language.

RES: Reset

SET

1

RES

0

Example

• Example • Timing diagram • Description Perform programming using the given example to gain experience.

:

nnnn SET

:

nnnn RES

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.

0000

0500 SET

0001

0500 RES

Coding Line No.

Instruction LD

0000

0001

SET

0500

0002

LD

0001

0003

OUB

0500

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.

• •

2

0001

#00100 C000 00000 C000 RES

0002

Note Describes the notes for the instruction.

0001

0002

Coding Shows the coding for the given example.

#00100 C000 0000

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 (➮ p. 3-57 and p. 3-71) 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.

Tips Describes hands-on techniques for efficient programming. Operand Shows operands (element Nos.) that can be used for the instruction.

Operand

0000

0000

0500 RES

0001

0500 SET

LD RES LD SET

0000

0000 0500 0001 0500

KEEP SET 0500

0001

LD 0000 LD 0001 KEEP 0500

RES

Operands NEW KV

KV-300

KV-10/16

KV-24/40/80

0500 to 1915 2009 2100 to 17915 T000 to T249 C000 to C249

0500 to 1915 2009 2100 to 17915 T000 to T249 C000 to C249

0500 to 1915 2009 2100 to 2915 T000 to T063 C000 to C063

0500 to 1915 2009 2100 to 6915 T000 to T119 C000 to C119

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

Key operation Describes the basic key operations on the handheld programmer. Set the mode switch to PROGRAM.

Key operation SET

1

Operand

ENT R-SRCH

RES

0

Operand

ENT R-SRCH

3-66 Chapter 2 Instructions

* The above page is created for explanation purposes only. This page may be different from the actual page.

Chapter 2 Instructions

3-55

12