Справочник Пользователя для Mitsubishi Electronics FX2NC

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-83
e) The HKY instruction may only be used ONCE.
f) Normal operation requires 8 scans to read the key
inputs. To ac hieve  a steady and  repeatable
performance, constant scan mode should be used,
i.e. M8039 is set ON and a user defined scan time
is written to register D8039. However, for a faster
r e s p o n s e   t h e   H K Y   i n s t r u c t i o n   s h o u l d   b e
programmed in a timer interrupt routine as shown
in the example opposite. 
Operation 2 - Using the HKY Instruction With
M8167: 
(Applicable units: FX
(2C) 
and FX
2N
)
When the HKY instruction is used with flag M8167 ON
(as shown right), the operation of keys A through F
allow actual entry of the Hexadecimal values of A
through F respectively into the data device D
2
. This is
in addition to the standard 0 through 9 keys. All other
operation is as specified in ‘Operation 1 - Standard’.
Maximum storage values for this operation become
FFFF in 16 bit mode and FFFFFFFF in 32 bit (double
word) mode.
5.8.3
DSW (FNC 72)
Operation:
This instruction multiplexes 4 outputs (D
1
) through 1
or 2(n) sets of switches. Each set of switches
consists of 4 thumbwheels providing a single digit
input.
Points to note:
a) When n = 1 only one set of switches are read. The
multiplex is completed by wiring the thumbwheels
in parallel back to 4 consecutive inputs from the
head address specified in operand S. The (4 digit)
data read is stored in data device D
2
.
Continued on next page...
Mnemonic
Function 
Operands
Program steps
S
D
1
D
2
n
DSW
FNC 72
(Digital 
switch)
Multiplexed
reading of n sets
of digital (BCD)
thumbwheels
X
Note:
If n=2 then 
8
devices
else 4.
Y
Note:
uses 4
consecu-
tive
devices
T, C, D, V, Z
Note: If
n=2 then 2
devices
else 1.
K, H
Note:
n= 1 or 2
DSW:
9 steps
Y 0
D 0
M 0
HKY
X 0
EI
FEND
K8
REF
X 0
K8
REF
Y0
IRET
END
M8000
I 610
X17
Y 60 D 5 M90
HKY X 10
M8167
X17
Y 60 D 5 M90
HKY X 10
SET
M8167
RST
M8167
These two program examples
perform the same task.
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
FLAGS
Operation
Complete M8029
X0
Y 10 D 0
[ D2 ]
K 1
DSW
[ D1 ]
X 10
[ S ]
[ n ]
1
2
4
8
4
2
1
10
10
10
0
1
2
3
X11 X12 X13
24V 0V S/S
X14 X15 X16 X17
Y12 Y13
+V Y10 Y11
1
2
4
8
X10
3
10
Transistor Outputs (source)
BCD digital 
switches
(1st set)
2nd 
switch
set inputs