KEYENCE Visual KV Series User Manual

Page 364

Advertising
background image

8.2 Details

3-340

8

Chapter 8 Programming Examples

0000

STA

TM03

LDA

#00030

STA

TM02

LDA

#00010

END

00

CALL

2002

NEXT

RET

ENDH

SBN

00

2002

STA

TM05

SUB

TM02

STA

TM04

ADD

#00001

LDA

TM03

FOR

TM05

2002

STA

#TM04

LDA

#TM03

DEC

TM04

DEC

TM03

STA

#TM02

LDA

#00000

1000
DIFU

1000

Shifts data from
DM0010 to DM0030.

Designates the
shift start
DM No. (DM0010).

Designates the
shift end
DM No. (DM0030).

Uses the indirect addressing
function to designate DM Nos.

Clears the start DM to #0000
after the data is shifted.

The program lines which
execute the data shift
are groped as the subroutine.

Shift level

Synchoronous
signal

External reset 0008 is predetermined on hardware even if you do not specify in
the program. However, you have to set external reset enable relay 2115 to ON.

Coding

Line No.

Instruction

Operand

Line No.

Instruction

Operand

0000

LD

2008

0014

LDB

0500

0001

EI

0015

CTH

1 0004

0002

CON

0016

CTC

0 #60000

0003

SET

2813

0017

LD

2002

0004

CON

0018

LDA

CTH0

0005

SET

2103

0019

CON

0006

CON

0020

STA

DM0000

0007

SET

2113

0021

END

0008

CON

0022

INT

CTC0

0009

RES

2114

0023

LD

2002

0010

CON

0024

SET

0500

0011

SET

2115

0025

RETI

0012

CON

0026

ENDH

0013

RES

CTH0

Application of Subroutine CALL

DM shift
Shifts the data from current DM to the next DM at UP edge of the synchronous
signal (timing).
As the number of DMs to be shifted increases, the required scan time becomes
longer.

Ladder diagram

CAUTION

KVNKA Chap 08.p65

08.3.11, 0:12 PM

340

Advertising