![Mitsubishi Electric M700V Series Скачать руководство пользователя страница 347](http://html.mh-extra.com/html/mitsubishi-electric/m700v-series/m700v-series_programming-manual_238523347.webp)
13. Program Support Functions
13.5 User Macro Specifications
335
(Example 1)
Example of workpiece position measurement
An example to measure the distance from the measured reference position to the
workpiece edge is shown below.
G65 L9031 X100. Y100. Z-10. F200;
F(#9) 200
X(#24)100.000
Y(#25)100.000
Z(#26) -10.000
#101 87.245
#102 87.245
#103 123.383
N1 #180=#4003;
N2 #30=#5001 #31=#5002;
N3 G91 G01 Z#26 F#9;
N4 G31 X#24 Y#25 F#9;
N5 G90 G00 X#30 Y#31;
N6 #101=#30-#5061 #102=#31-#5062;
N7 #103=SQR [#101
∗
#101+#102*#102] ;
N8 G91 G01Z-#26;
N9 IF [#180 EQ 91] GOTO 11;
N10 G90;
N11 G23;
To subprogram
Main program
Argument
<Local variable>
L9031
<Common variable>
Start point
Skip input
N3
N4
N5
N8
#103
#102
#101
X
Z
Y
#101 X axis measurement amount
N1
G90/G91 modal recording
#102 X axis measurement amount
N2
X, Y start point recording
#103 Measurement linear segment
N3
Z axis entry amount
amount
N4
X, Y measurement (Stop at skip input)
#5001 X axis measurement start point
N5
Return to X, Y start point
#5002 Y axis measurement start point
N6
X, Y measurement incremental value
calculation
N7
Measurement linear segment calculation
#5061 X axis skip input point
N8
Z axis escape
#5062 Y axis skip input point
N9, N10 G90/G91 modal return
N11
Subprogram
return
(Example 2)
Reading of skip input coordinates
-Y
-50
-75
-100
N1 G91 G28 X0 Y0;
N2 G90 G00 X0 Y0;
N3 X0Y-100.;
N4 G31 X-150. Y-50. F80;
N5 #111=#5061#112=#5062;
N6 G00 Y0;
N7 G31 X0;
N8 #121=#5061#122=#5062;
N9 M02;
-150
-75
-25
Y
X
-X
Skip signal
#111 =
−
75. +
ε
#112 =
−
75. +
ε
#121 =
−
25. +
ε
#122 =
−
75. +
ε
ε
is the error caused by response delay.
(Refer to the section on the skip function for details.)
#122 is the N4 skip signal input coordinates as there is no Y command at N7.