blob: 2e36fc719bd758aadd0ff3e3433c416d35570e0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
%
(Program to test M73 save context/auto-restore context on return)
(M. Haberler)
o1000 sub
o1001 if [#1 GT 0]
M73 (save context and auto-restore on return and endsub)
o1001 endif
G90 (absolute)
G0 X5 Y20
o1002 if [#2 EQ 1]
o1002 return (trigger auto-restore on return)
o1002 endif
o1005 if [#2 EQ 2]
M72 (explicitly restore context of this frame)
M71 (invalidate current frame)
o1005 return (no triggering of auto-restore-on-return since frame now invalid)
o1005 endif
o1000 endsub (trigger auto-restore on endsub if m73 issued and not invalidated)
G90
G53 G0 X0 Y0 Z0
G91 (relative)
g0 x10 y10
g0 x10 y10
o1000 call [1.0] [0.0]
(back in relative mode due to M73 restore-on-endsub)
(debug, incremental=#<_incremental>)
o1000 call [1.0] [1.0]
(back in relative mode due to M73 restore-on-return)
(debug, incremental=#<_incremental>)
g0 X-5 Y-20
o1000 call [0.0] [0.0]
G91 (relative)
g0 x10 y10
g0 x10 y10
o1000 call [0.0] [0]
(debug, incremental=#<_incremental>)
%
|