KEYENCE Visual KV Series User Manual

Page 359

Advertising
background image

8.2 Details

3-335

1

8

Chapter 8 Programming Examples

Application of STG-JMP instruction

Enabling double coil
When start SW 0000 is pressed, output relay 0500 turns ON for 1 s, then output
relays 0500 and 0501 turn ON for 2 s, and then output relays 0500, 0501, and 0502
turn ON for 3 s. The above sequence repeats.

Ladder diagram

Coding

The double coil operates normally through different STG instructions. If
different STG instructions turn ON simultaneously, the latter programmed
instruction has the priority.

Conditional branching
When input relay 0000 (start SW) turns ON, output relay 0500 turns ON. Then, as
programmed for conditional branching, output 0501 turns ON for 1 s when 0001
turns ON or 0502 turns ON for 2 s when 0002 turns ON. After either one of the
processes is completed, the program returns to the conditional branching and
repeats the same steps.

Ladder diagram

0000

1001

JMP

SET

1000

1100

DIFU

1100

1000

STG

T000

#00010

T000

1002

JMP

1001
STG

T001

#00020

T001

1000

JMP

1002

STG

T002

#00030

T002

0500

0501

0502

0501

0500

0500

Turns ON 1000 when input relay 0000 turns ON.

Output relay 0500 turns ON for 1 s.

Output relays 0500 and 0501 turn ON for 2 s.

Output relays 0500, 0501 and 0502 turn ON for 3 s.

Line No.

Instruction

Operand

Line No.

Instruction

Operand

0000

LD

0000

0016

CON

0001

DIFU

1100

0017

TMR

001 #00020

0002

CON

0018

CON

0003

AND

1100

0019

AND

T001

0004

SET

1000

0020

JMP

1002

0005

STG

1000

0021

STG

1002

0006

OUT

0500

0022

OUT

0500

0007

CON

0023

CON

0008

TMR

000 #00010

0024

OUT

0501

0009

CON

0025

CON

0010

AND

T000

0026

OUT

0502

0011

JMP

1001

0027

CON

0012

STG

1001

0028

TMR

002 #00030

0013

OUT

0500

0029

CON

0014

CON

0030

AND

T002

0015

OUT

0501

0031

JMP

1000

CAUTION

0000

1001

JMP

SET

1000

1100

DIFU

1100

1000

STG

0001

1002

JMP

0002

1000

JMP

1001

STG

T000

#00010

T000

0500

0501

1000

JMP

1002

STG

T001

#00020

T001

0502

KVNKA Chap 08.p65

08.3.11, 0:12 PM

335

Advertising