Hello Guest it is December 02, 2023, 08:11:35 PM

Author Topic: Program hanging  (Read 18013 times)

0 Members and 1 Guest are viewing this topic.

Program hanging
« on: June 03, 2011, 11:28:15 AM »
A new issue has come up.  Fairly frequently the G-Code program will hang at the last line.  The program just stops.  There is no error.  The program just stops after executing a G0X0Y0 and before the M30.  The result is that the M30 does not execute, the program does not rewind and the outputs stay on.  See program below.  When it hangs, if I hit estop then reset, the program rewinds and the M30 seems to execute.   Any ideas on what could cause this?  The kicker is that it doesn't do it all the time, just most of the time...and it hung up once on the first line of code.  

 It's a new machine, but I can run the same program over and over all day long on our other machine and it runs fine.  Is there a config setting somewhere that I missed?  The other machine is running a slightly older version of Mach.


G20 G40 G91.1 M7 M1100
G0 Z0.375
G0 X2.94 Y1.47
G04 P0.25
G01 X2.9391 Y1.5213
G01 X2.9364 Y1.5725
G01 X2.9319 Y1.6237
G01 X2.9257 Y1.6746
G01 X2.9177 Y1.7253
G01 X2.9079 Y1.7756
G01 X2.8963 Y1.8256
G01 X2.8831 Y1.8752
G01 X2.8681 Y1.9243
G01 X2.8513 Y1.9728
G01 X2.833 Y2.0207
G01 X2.8129 Y2.0679
G01 X2.7912 Y2.1144
G01 X2.7679 Y2.1601
G01 X2.7431 Y2.205
G01 X2.7166 Y2.249
G01 X2.6887 Y2.292
G01 X2.6593 Y2.334
G01 X2.6284 Y2.375
G01 X2.5961 Y2.4149
G01 X2.5624 Y2.4536
G01 X2.5274 Y2.4911
G01 X2.4911 Y2.5274
G01 X2.4536 Y2.5624
G01 X2.4149 Y2.5961
G01 X2.375 Y2.6284
G01 X2.334 Y2.6593
G01 X2.292 Y2.6887
G01 X2.249 Y2.7166
G01 X2.205 Y2.7431
G01 X2.1601 Y2.7679
G01 X2.1144 Y2.7912
G01 X2.0679 Y2.8129
G01 X2.0207 Y2.833
G01 X1.9728 Y2.8513
G01 X1.9243 Y2.8681
G01 X1.8752 Y2.8831
G01 X1.8256 Y2.8963
G01 X1.7756 Y2.9079
G01 X1.7253 Y2.9177
G01 X1.6746 Y2.9257
G01 X1.6237 Y2.9319
G01 X1.5725 Y2.9364
G01 X1.5213 Y2.9391
G01 X1.47 Y2.94
G01 X1.4187 Y2.9391
G01 X1.3675 Y2.9364
G01 X1.3163 Y2.9319
G01 X1.2654 Y2.9257
G01 X1.2147 Y2.9177
G01 X1.1644 Y2.9079
G01 X1.1144 Y2.8963
G01 X1.0648 Y2.8831
G01 X1.0157 Y2.8681
G01 X0.9672 Y2.8513
G01 X0.9193 Y2.833
G01 X0.8721 Y2.8129
G01 X0.8256 Y2.7912
G01 X0.7799 Y2.7679
G01 X0.735 Y2.7431
G01 X0.691 Y2.7166
G01 X0.648 Y2.6887
G01 X0.606 Y2.6593
G01 X0.565 Y2.6284
G01 X0.5251 Y2.5961
G01 X0.4864 Y2.5624
G01 X0.4489 Y2.5274
G01 X0.4126 Y2.4911
G01 X0.3776 Y2.4536
G01 X0.3439 Y2.4149
G01 X0.3116 Y2.375
G01 X0.2807 Y2.334
G01 X0.2513 Y2.292
G01 X0.2234 Y2.249
G01 X0.1969 Y2.205
G01 X0.1721 Y2.1601
G01 X0.1488 Y2.1144
G01 X0.1271 Y2.0679
G01 X0.107 Y2.0207
G01 X0.0887 Y1.9728
G01 X0.0719 Y1.9243
G01 X0.0569 Y1.8752
G01 X0.0437 Y1.8256
G01 X0.0321 Y1.7756
G01 X0.0223 Y1.7253
G01 X0.0143 Y1.6746
G01 X0.0081 Y1.6237
G01 X0.0036 Y1.5725
G01 X0.0009 Y1.5213
G01 X0 Y1.47
G01 X0.0009 Y1.4187
G01 X0.0036 Y1.3675
G01 X0.0081 Y1.3163
G01 X0.0143 Y1.2654
G01 X0.0223 Y1.2147
G01 X0.0321 Y1.1644
G01 X0.0437 Y1.1144
G01 X0.0569 Y1.0648
G01 X0.0719 Y1.0157
G01 X0.0887 Y0.9672
G01 X0.107 Y0.9193
G01 X0.1271 Y0.8721
G01 X0.1488 Y0.8256
G01 X0.1721 Y0.7799
G01 X0.1969 Y0.735
G01 X0.2234 Y0.691
G01 X0.2513 Y0.648
G01 X0.2807 Y0.606
G01 X0.3116 Y0.565
G01 X0.3439 Y0.5251
G01 X0.3776 Y0.4864
G01 X0.4126 Y0.4489
G01 X0.4489 Y0.4126
G01 X0.4864 Y0.3776
G01 X0.5251 Y0.3439
G01 X0.565 Y0.3116
G01 X0.606 Y0.2807
G01 X0.648 Y0.2513
G01 X0.691 Y0.2234
G01 X0.735 Y0.1969
G01 X0.7799 Y0.1721
G01 X0.8256 Y0.1488
G01 X0.8721 Y0.1271
G01 X0.9193 Y0.107
G01 X0.9672 Y0.0887
G01 X1.0157 Y0.0719
G01 X1.0648 Y0.0569
G01 X1.1144 Y0.0437
G01 X1.1644 Y0.0321
G01 X1.2147 Y0.0223
G01 X1.2654 Y0.0143
G01 X1.3163 Y0.0081
G01 X1.3675 Y0.0036
G01 X1.4187 Y0.0009
G01 X1.47 Y0
G01 X1.5213 Y0.0009
G01 X1.5725 Y0.0036
G01 X1.6237 Y0.0081
G01 X1.6746 Y0.0143
G01 X1.7253 Y0.0223
G01 X1.7756 Y0.0321
G01 X1.8256 Y0.0437
G01 X1.8752 Y0.0569
G01 X1.9243 Y0.0719
G01 X1.9728 Y0.0887
G01 X2.0207 Y0.107
G01 X2.0679 Y0.1271
G01 X2.1144 Y0.1488
G01 X2.1601 Y0.1721
G01 X2.205 Y0.1969
G01 X2.249 Y0.2234
G01 X2.292 Y0.2513
G01 X2.334 Y0.2807
G01 X2.375 Y0.3116
G01 X2.4149 Y0.3439
G01 X2.4536 Y0.3776
G01 X2.4911 Y0.4126
G01 X2.5274 Y0.4489
G01 X2.5624 Y0.4864
G01 X2.5961 Y0.5251
G01 X2.6284 Y0.565
G01 X2.6593 Y0.606
G01 X2.6887 Y0.648
G01 X2.7166 Y0.691
G01 X2.7431 Y0.735
G01 X2.7679 Y0.7799
G01 X2.7912 Y0.8256
G01 X2.8129 Y0.8721
G01 X2.833 Y0.9193
G01 X2.8513 Y0.9672
G01 X2.8681 Y1.0157
G01 X2.8831 Y1.0648
G01 X2.8963 Y1.1144
G01 X2.9079 Y1.1644
G01 X2.9177 Y1.2147
G01 X2.9257 Y1.2654
G01 X2.9319 Y1.3163
G01 X2.9364 Y1.3675
G01 X2.9391 Y1.4187
G01 X2.94 Y1.47
G00 Z0.375
G00 X0 Y0
« Last Edit: June 03, 2011, 11:29:54 AM by rrc1962 »

Offline BR549

  •  6,965 6,965
    • View Profile
Re: Program hanging
« Reply #1 on: June 03, 2011, 11:53:11 AM »
That little problem has been around for a long time(;-) Same as failing to run an M3 on occasion. SOme computers have the problem some don't. I always thought it was a problem in the way MACH handles threading of the various codes.

BUT who knows ?

(;-) TP
« Last Edit: June 03, 2011, 11:54:48 AM by BR549 »
Re: Program hanging
« Reply #2 on: June 03, 2011, 12:21:56 PM »
Is there a work around?  Is the known issue one that just hangs on the last line or is it that the program will hang anywhere?
Re: Program hanging
« Reply #3 on: June 03, 2011, 12:44:53 PM »
Try this, load the program and edit it, go to the end of the last line and hit enter a couple times.
save and run again.

Offline Tweakie.CNC

  • *
  •  9,160 9,160
  • Super Kitty
    • View Profile
Re: Program hanging
« Reply #4 on: June 03, 2011, 12:49:46 PM »
Isn't this the reason programs should finish with a null line such as % ?

Try adding % as the last line.

Re: Program hanging
« Reply #5 on: June 03, 2011, 01:23:20 PM »
Yes, it adds a "carriage return" character to the last line of code that is to be run (not visible)
the "%" is a way of ensuring the previous line of code has a carriage return at the end of it.
Re: Program hanging
« Reply #6 on: June 03, 2011, 03:34:35 PM »
OK...The problem was not the M30, but the second G00 move...

G00 Z0.375
G00 X0 Y0    (Hanging on this line)

You could even see on the toolpath display where motion stopped before the command finished in some cases.  Any instance in the code where there were two G00 moves like this, it hung up.  On multiple parts, for instance, the Z retracted and then hung on the next rapid to the next cut.

I set up another PC (identical in specs) and it works fine.

Offline BR549

  •  6,965 6,965
    • View Profile
Re: Program hanging
« Reply #7 on: June 03, 2011, 04:46:35 PM »
IF it were the LACK of the carriage return it would NEVER had worked(;-).  OP said it only failed sometimes. SAME as I see here.

(;-) TP

Re: Program hanging
« Reply #8 on: June 03, 2011, 06:04:50 PM »
I just cut and pasted that last bit of code into notepad
it did not even show "m30" on the screen (tho it was in the program)
it hung on the same line as yours did
I edited it and added a carriage return and it worked fine (;-)
Re: Program hanging
« Reply #9 on: June 03, 2011, 06:22:27 PM »
If it hangs up in the middle of your code with two G00 lines, then I have no clue as to why.