What's new
What's new

Improper G-Code

huskermcdoogle

Stainless
Joined
Nov 11, 2005
Location
South Texas
I was trying to post a program to a Hardinge Cobra Lathe

Fanuc 21-T Controller

It gives an Error 010 Improper G-Code

I have no idea what this means but I will post the first part of the code and see if any of you think you know what is wrong.

it stops at the G50 S3600
%
O0000
G20
(PROGRAM NAME - HELP DATE=DD-MM-YY - 04-01-06 TIME=HH:MM - 17:32)
(TOOL - 1 OFFSET - 1)
(LROUGH OD ROUGH RIGHT - 80 DEG. INSERT - CNMG-432)
G0T0101
G97S216M13
G0G54X3.5341Z.11
G50S3600
G96S200
G99G1Z-2.84F.01
X3.7339Z-3.0141
X3.8753Z-2.9434
G0Z.11

this is obviously abreivated but it makes it no further than the G50 when you go back to edit.

No idea that is wrong. Compared it to other programs in the memory that i have ran in the past and see no differences up to that point.
 
G0T0101 (=====where is line N101? ===)

G97S216M13
G0G54X3.5341Z.11
G50S3600
G96S200
G99G1Z-2.84F.01
X3.7339Z-3.0141
X3.8753Z-2.9434
G0Z.11
 
The alarm #10 is only going to happen if you try to use a G-code that your CNC is not equipped to use. This can happen if there's an option not installed, or if the G-code you're using is not recognized by the control at all.

Some CNCs are set up to use EIA G-codes instead of the usual Fanuc JIS (Japanese Industrial Standard) G-codes so, for example, G20/21 for inch/metric might really be G70/71 on your machine.

Try entering each of the G-codes in your program in MDI mode. The alarm #10 will tell you which one is the culprit.
 
I think the G54 is the culprit. Are you using the W.SHIFT to set the z? Can you find G54 etc in the offset pages?
 
Nobody has spotted it have they?

try G92 S3600 instead of G50 S3600

Some lathes are funny about that


Boris
 
Sorry about not being up to speed on replying. Just got finished welding up some bike frames....

M13 is spindle counter clockwise on coolant on

G20 is supposed to be used

G99 - IPR is what i want to use and is what i have used in the past with this machine

G96 - Always works

G50 - has worked in the past.

Frankly nothing has changed and this thing won't work.

Gonna get some live help tommorow but any more ideas are very welcome.

All G codes listed there work in MDI without and alarm.

G54 is the only one i question but is in other programs. 90% or programs written for this lathe are from mastercam same post, same computer.

I am literally dumbfounded. I can usaully figure these things out. Can't find the manual that tells what the ararms are either. Damn disorganized shop.

Husker
 
The only thing, see if programming G54 in it's own block makes a difference.
Not sure if the machine likes calling a workoffset and positioning in it in the same block.
 
Below is a "cut & paste" of text from the 21T operator's manual section on the G54-G59 coordinate systems. In your program, the G54 coordinate system is selected first, then you give it the G50S3600. Normally, the G50S--- command is just to set the upper limit of the spindle speed in CSS so it shouldn't matter, but this statement may explain your problem:

(from manual):

When bit 2 (G50) of parameter No. 1202 is set to 1, executing the G50
command results in the issue of P/S alarm No. 10. This is designed
to prevent the user from confusing coordinate systems.

Try giving the G50S3600 command before you select G54.
 
looks like a mastercam post.
error may be further in the program.
 
Dan

Wonderful example of Japano-English translation.
Does that mean that G50 can only be invoked at the beginning of the program and never again until an M30?
Not very useful if you want to limit for turning at one speed and for cutoff at another.
 
You can always set parameter 1202 bit 2 to a "0" if you don't want it to throw the alarm.

Check to see if that bit is a "1" now (bit 2 is the 3rd bit from the right). If it is a "1", set it to zero and then just be careful to not try to use G50 to preset the coordinate system when in G54. Using G50 to set the spindle speed limit should never be a problem, even in G54.

Did you try running your program with the G50S3600 block ahead of the G54 block ?
 
I took the G54 out becuase it really doesn't need to be there becuase i am only using one tool and just set the ofsets that way...

Works without the G54.

Thanks for all the help.

Husker
 
M13 is spindle counter clockwise on coolant on
M13 is spindle on ClockWise/coolant on.


looks like a mastercam post.
error may be further in the program.
Error should be in the line after it stops. At least on the 18-T. I have a 21-I too - but can't say 100% for sure on that one. ???


Think Snow Eh!
Ox
 








 
Back
Top