Application of stg and jmp instructions – KEYENCE Visual KV Series User Manual

Page 136

Advertising
background image

2.4 Instruction Details

3-112

2

Chapter 2 Instructions

JMP operand

Unlike the STG operand relay, the JMP operand relay No. can be duplicated in a
program.

DIFU/DIFD instructions in an STG block

The operand relay for an STG instruction cannot be used as the input operand relay
for a DIFU or DIFD instruction.

Application of STG and JMP instructions

Enabling a double coil
When start SW 0000 is pressed, the following output operation is repeated:
Output relay 0500 turns ON for 1 second.

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

Coding

0002

1001

STG

1002

JMP

0501

0001

1000

STG

1001

JMP

1002

JMP

0500

0501

0001

3000

1000

STG

3000
DIFU

1001

JMP

0500

1100

T000

1001

JMP

1100
DIFU

#00010

T000

0500

1000

STG

T001

1002

JMP

#00020

T001

0501

0500

1001

STG

T002

1000

JMP

#00030

T002

0502

0501

0500

1002

STG

1000

SET

0000

Outputs 0500, 0501, and 0502 turn ON for
3 seconds.

1000 turns ON at the rising edge of input 0000.

Output 0500 turns ON for 1 second.

Outputs 0500 and 0501 turn ON for 2 seconds.

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

STG / JMP

KVNKA Chap 02_4bP.p65

08.3.11, 0:00 PM

112

Advertising