beautypg.com

Application of mpx and dmx instructions – KEYENCE Visual KV Series User Manual

Page 201

background image

2.4 Instruction Details

1

2

3-177

Chapter 2 Instructions

Description

Operation with the MPX instruction

When input relay 0000 is ON, the ON/OFF status of input relays 0000 through 0015
is transferred to the internal register. The section of the internal register specified by
the operand (input relays 0004 through 007: 4 bits) is converted into a hexadecimal
number (0 to F). Only the bit at the position specified by the hexadecimal number is
set to "1" and other bits are set to "0". The resulting ON/OFF status is input back to
the internal register, and then output to inputs 1000 to 1015.
In the example, when the value specified by inputs 0004 to 0007 are converted into
"A", internal relay 1010 turns ON.

Operation with the DMX instruction

When input relay 0001 is ON, the ON/OFF status of input relays 0100 through 0115
is sent to the internal register. Within the 16-bit data of the internal register, the
number corresponding to the position of the most significant bit with "1" (0 to F) is
converted into 4-bit data and input back to the internal register. The contents of the
internal register are then transferred to DM0000.
In the example, when input relay 0114 turns ON, "E" is input to DM0000.

The DMX instruction is disabled when all bits in the internal register are OFF. In
such a case, special utility relay 2012 turns ON.

Application of MPX and DMX instructions

MPX instruction
Connect the one-digit data of a BIN digital switch to input relays 0004 through 0007.
Connect output relays 0500 through 0515 to lamps 0 to 15.
An operator turns on the lamp corresponding to the digital switch using binary
numbers.

When the digital switch shows "8", output 0508 turns ON, therefore, lamp 8 lights.

1 0 1 0

#3

#2

#1

A

#0

0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0

F E D C B A 9 8 7 6 5 4 3 2 1 0

No. represented by the section of the
internal register specified by operand

Operand

Internal register

Internal register

0 to F

0 1 0 1 1 0 0 1 0 1 0 0 0 1 0 0

0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0

F E D C B A 9 8 7 6 5 4 3 2 1 0

The value is converted into a hexadecimal number.

Most significant bit with "1"

Enter the number of the most
significant bit with "1".

2002

0000

LDA

#1

MPX

0500

STA

MPX / @MPX / DMX / @DMX

KVNKA Chap 02_4dP.p65

08.3.11, 0:04 PM

177