Skip to content

Commit 8232fd8

Browse files
committed
Adding testcase for 6bf6287 endless loop in g71 fix.
1 parent 111fd21 commit 8232fd8

3 files changed

Lines changed: 117 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
2+
N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
3+
N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
4+
N..... SET_XY_ROTATION(0.0000)
5+
N..... SET_FEED_REFERENCE(CANON_XYZ)
6+
N..... ON_RESET()
7+
N..... COMMENT("interpreter: continuing to use same coordinate system")
8+
N..... COMMENT("interpreter: Lathe diameter mode changed to diameter")
9+
N..... SELECT_PLANE(CANON_PLANE_XZ)
10+
N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
11+
N..... SET_SPINDLE_MODE(0 1400.0000)
12+
N..... SET_SPINDLE_SPEED(0, 200.0000)
13+
N..... START_SPINDLE_CLOCKWISE(0)
14+
N..... COMMENT("interpreter: feed mode set to units per revolution")
15+
N..... SET_FEED_MODE(0, 1)
16+
N..... SET_FEED_RATE(0.0000)
17+
N..... SET_FEED_RATE(0.1200)
18+
N..... SET_G92_OFFSET(0.0000, 0.0000, -1.9000, 0.0000, 0.0000, 0.0000)
19+
N..... STRAIGHT_TRAVERSE(10.0000, 0.0000, 2.8000, 0.0000, 0.0000, 0.0000)
20+
N..... STRAIGHT_TRAVERSE(10.0000, 0.0000, 2.8000, 0.0000, 0.0000, 0.0000)
21+
N..... STRAIGHT_FEED(11.3630, 0.0000, 2.8000, 0.0000, 0.0000, 0.0000)
22+
N..... STRAIGHT_FEED(11.3630, 0.0000, 0.8229, 0.0000, 0.0000, 0.0000)
23+
N..... ARC_FEED(-0.5000, 11.8630, -0.5000, 9.8630, 1, 0.0000, 0.0000, 0.0000, 0.0000)
24+
N..... STRAIGHT_FEED(11.8630, 0.0000, -4.0318, 0.0000, 0.0000, 0.0000)
25+
N..... ARC_FEED(-5.0000, 12.1130, -5.0000, 10.1130, 1, 0.0000, 0.0000, 0.0000, 0.0000)
26+
N..... STRAIGHT_FEED(12.1130, 0.0000, -25.0000, 0.0000, 0.0000, 0.0000)
27+
N..... ARC_FEED(-27.0000, 10.1130, -25.0000, 10.1130, 1, 0.0000, 0.0000, 0.0000, 0.0000)
28+
N..... STRAIGHT_FEED(10.0000, 0.0000, -27.0000, 0.0000, 0.0000, 0.0000)
29+
N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
30+
N..... COMMENT("interpreter: cutter radius compensation on right")
31+
N..... STRAIGHT_TRAVERSE(10.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000)
32+
N..... STRAIGHT_TRAVERSE(10.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000)
33+
N..... STRAIGHT_TRAVERSE(9.3630, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000)
34+
N..... STRAIGHT_FEED(9.3630, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
35+
N..... STRAIGHT_FEED(9.8630, 0.0000, -0.5000, 0.0000, 0.0000, 0.0000)
36+
N..... STRAIGHT_FEED(9.8630, 0.0000, -5.0000, 0.0000, 0.0000, 0.0000)
37+
N..... STRAIGHT_FEED(10.1130, 0.0000, -5.0000, 0.0000, 0.0000, 0.0000)
38+
N..... STRAIGHT_FEED(10.1130, 0.0000, -25.0000, 0.0000, 0.0000, 0.0000)
39+
N..... STRAIGHT_FEED(10.0000, 0.0000, -25.0000, 0.0000, 0.0000, 0.0000)
40+
N..... COMMENT("interpreter: cutter radius compensation off")
41+
N..... MIST_OFF()
42+
N..... FLOOD_OFF()
43+
N..... STRAIGHT_TRAVERSE(12.5000, 0.0000, -25.0000, 0.0000, 0.0000, 0.0000)
44+
N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
45+
N..... SET_XY_ROTATION(0.0000)
46+
N..... SELECT_PLANE(CANON_PLANE_XY)
47+
N..... SET_FEED_MODE(0, 0)
48+
N..... SET_FEED_RATE(0.0000)
49+
N..... STOP_SPINDLE_TURNING(0)
50+
N..... SET_SPINDLE_MODE(0 0.0000)
51+
N..... PROGRAM_END()
52+
N..... ON_RESET()
53+
N..... ON_RESET()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#<_initial>=20
2+
#<_final>=19.726
3+
#<_champher>=0.5
4+
#<_zmax>=0
5+
#<_zmin>=-25
6+
#<doc>=2
7+
8+
G54
9+
G7
10+
G18
11+
G21
12+
13+
o100 sub
14+
o101 if [#<_champher> gt 0]
15+
G1 X[#<_final>-2.0001*#<_champher>]
16+
Z#<_zmax>
17+
X#<_final>C#<_champher>
18+
o101 else
19+
X#<_final>
20+
o101 endif
21+
W-5
22+
U0.5
23+
Z#<_zmin>
24+
X#<_initial>
25+
o100 endsub
26+
27+
M3 G96 S200 d1400
28+
G95 F0.12
29+
G52 z[0.1-#<doc>]
30+
;m7
31+
G71 Q100 Z[#<_zmax>+0.8+#<doc>] X#<_initial> D#<doc> I#<doc> R0.3
32+
G52 z0
33+
;m7
34+
g42
35+
G70 Q100 Z[#<_zmax>+1] X#<_initial> D#<doc> P1
36+
g40
37+
M9
38+
G0X[#<_initial>+5]
39+
40+
M2
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
#
3+
# Demonstrate endless loop when encountering incorrect parameters in
4+
# G71 call. Note, the expected output is not verified. No idea what
5+
# it should look like on a successful termination of this endless
6+
# loop.
7+
8+
rs274 -g g71-endless-loop_2.ngc | awk '{$1=""; print}' > result &
9+
pid=$!
10+
11+
# Give it 10 seconds to complete
12+
count=10
13+
while [ 0 -lt $count ] && kill -0 $pid > /dev/null 2>&1 ; do
14+
sleep 1
15+
count=$(($count - 1))
16+
done
17+
18+
if kill -0 $pid > /dev/null 2>&1; then
19+
kill -9 $pid
20+
echo "error: g71-endless-loop.ngc program seem to be stuck, killing"
21+
exit 1
22+
fi
23+
24+
exit 0

0 commit comments

Comments
 (0)