![Mitsubishi Electric CR750 Series Скачать руководство пользователя страница 726](http://html.mh-extra.com/html/mitsubishi-electric/cr750-series/cr750-series_instruction-manual_238840726.webp)
Appendix-706
Get-position-quick function
<Sample program>
(2) Workpiece presence recognition in a cassette
This section shows the basic method to create programs using the MELFA BASIC V programming language
for the mapping (detecting the presence of a workpiece.) in the cassette.
Table 7-31: Command list of MELFA BASIC V
Table 7-32: Status variables list
1) Definition of the monitoring condition
First, define a condition (an input signal number, a signal condition, and a mechanism number) for the
position data acquisition according to an external signal input timing and a cassette condition (the
coordinates data and the number of segments for a cassette) in the Def Map command. Up to eight
different conditions can be set. Each setting of condition is controlled by the monitoring number.
2) Starting the monitoring
When the GpsChk On command ("GpsChk On,n" statement) is executed, start monitoring for the tar-
get monitoring number which is defined in the Def map command, and store the robot position data at
the point of time when the condition holds. Up to 400 position data can be obtained for one monitoring
number.
("n" in "GpsChk On,n" statement indicates the target monitoring number from 1 to 8.)
3) Stopping the monitoring
The segment number in which the workpiece is present is calculated from the position data obtained
at the time when the GpsChk Off command ("GpsChk Off,n" statement) is executed and from the data
of cassette shape and robot position. A result of the calculation is stored in the status variable
M_MapX(). ("X" indicates the same number as the target monitoring number from 1 to 8.)
The number of stored position data is retained in the status variable M_Gps(n).
The data stored in the M_Gps(n) and M_MapX() is cleared to zero when the GpsChk On command
("GpsChk On,n" statement) is executed next time.
("n" in "GpsChk Off,n" statement and the status variable M_Gps(n) indicates the target monitoring
number from 1 to 8.)
1 Def Gps 1,850,On,1
‘ The position data of the mechanism No. 1 is recorded for the monitoring No. 1 when the signal
No. 850 is turned on.
2 GpsChk On,1
‘ Monitoring a condition for the monitoring No. 1 is started.
3 Mvs P1
‘ Moves to P1
4 GpsChk Off,1
‘ Monitoring a condition for the monitoring No. 1 is stopped (the position data obtained is stored).
5 M1=M_Gps(1)
‘ The number of the position data recorded in the P_Gps1 is stored.
6 If M1=0 Then Error 9000
‘ The error 9000 is generated if no position data is recorded.
7 P1=P_Gps1(1)
‘ The position data at the first time when the signal No. 850 is turned on is substituted for "P1".
8 Hlt
‘ Halt program
Command
Explanation
Def Map
This command defines a condition for the workpiece presence recognition in the cassette, using the
GPS function.
GpsChk
This command starts/stops monitoring the set condition.
Variable name
No. of array elements
Details
M_Gps(n)
(n:target monitoring num-
ber from 1 to 8)
1 to 8 (target monitoring
number)
The number of the position data recorded in the status variable
P_GpsX() is stored. ("X" indicates the same number as the target moni-
toring number from 1 to 8.)
P_Gps1(x) to
P_Gps8(x)
400 (data)
Up to 400 robot position data at the time when the condition for the target
input number defined in the Def Map command is met is stored.
M_Map1(x) to
M_Map8(x)
130 (segments)
"1" is stored for the segment number in which the workpiece is present,
calculated from the condition defined in the Def Map command.