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

Скачать
Страница из 382
FX Series Programmable Controllers
Points Of Technique 10
10-8
10.11
Creating a User Defined MTR Instruction
For users who want to have the benefits of the MTR
instruction for FX users who want to specify more
than one MTR area, this user defined MTR function
will be very useful.
Explanation:
The main control of this program rests in the timer
interrupt I620. This interrupt triggers every 20msec
regardless of what the main program is doing. On
each interruption one bank of the user defined
matrix is read. The program simply consists of
re adin g  t h e   i n p u t s   t ri gg e r e d   b y   e a c h   o f   th e
multiplexed outputs.
The read data is then stored in sequential sets of
auxiliary registers.
E a c h  M OV  i n s t r u c t i o n   re a d s   a  n e w   b a n k   o f
multiplexed inputs.
T h e   e q u i v a l e n t   M T R   i n s t r u c t i o n   i s   s h o w n
immediately before the 'user defined' MTR.
See the MTR instruction on page 5-54 for more
details.
10.12
An Example System
Application Using STL And IST Program Control
The following illustration shows a simple 'pick and
place' system utilizing a small robotic arm. The zero
point has been de-fined as the uppermost and left
most position accessible by the robot arm.
A normal sequence of events
A product is carried from point 'A' to point 'B' by the
robot arm. To achieve this operation the following
sequence of events takes place:
Initial position: the robot arm is at its zero point.
1) The Robots grip is lowered to it lowest limit
-
output Y0: ON, input X1: ON, output Y0: OFF.
2) The grip clamped around the product at point A
-
output Y1: ON.
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
On each scan of
this routine a 
differentinput
block is read
M8000
EI
FEND
X30
MTR
M8000
Y30
REF
Y31
Y30 M100 K4
I620
K8
X30
MOV
K2M100
K2X30
MOV
K2M110
K2X30
Y32
Y33
MOV
K2M120
K2X30
MOV
K2M130
K2X30
Y33
PLS M499
Y32
PLS
IRET
Y31
PLS
END
Y30
PLS
Y33
M8000
REF
K8
Y30
PLS
Y30
Y30Y31Y32Y33
M499
Y31
Y32
Equivalent
MTR instruction
The interrupt
routine is scanned
every 20 msec
This program
area controls
which input block
will be read
X30-37 is
refreshed at the 
start of the
routine while
Y30-37 are 
refreshed here
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
A
B