G-Code

Jim Dungar

Member
Join Date
Apr 2002
Location
WI
Posts
1,152
My apologies to Terry for straying from PLCs but;

I am looking for a conversion program to create G Code (for an old GE Fanuc 10T CNC). I am hoping for something that will run on a PC and go from conversational to G Code. We would then manually input the G code.

Yeah, I know it would be best to upgrade the machine but that is more than we need. This CNC will be dedicated to machining one part.

Any suggestions?
 
What do you mean by conversational?

There are programs that can convert from cad to G-code.

If it is dedicated, why not just write the program in G-code or find someone who can? It is not that difficult unless the part is really complex. (We engineers can't just answer a question, we always have to question the whole approach.)
 
And Jim, what the heck do you mean by giving apologies to me?

Oh... perhaps because it's not about "programming"?

I have never ranted that this is a PLC Programming "only" site.

What I have ranted about is the lack of philosophical programming questions.

No... I don't mean philosophical in an Existential sorta way.

I don't think, "I THINK I AM - A PLC. THEREFORE, I AM - A PLC."
(My apologies, Rene)

I mean "philosophical" in the sense that, I wish there were more people interested in examining and raising questions about the Art of Programming and the Logical Development of a Program for a Process.

After all, the program exists for the purpose of supporting a process!

Programming a PLC is nothing! Any idiot can do it if he just reads a few pages of the manual.

Now, developing a process... now there's the Holy Grail!

That's were the difference between a PLC-Swinging (as in big-hammer-swinging) programmer and a real programmer becomes glaring.

That is, the Art of Logical Development vs. the Picasso-type Development of a Hacker (Don't ask me to explain... All I know is that it's right there, hanging on the wall! And it costs bucu-bucks! Now, you try to explain it... I can't!).

Some just don't understand that programming with finesse beats the living hell out of programming with brute-force and other such big-hammer methods.

This stuff REALLY, REALLY is an ART! Just like Rembrandt, DaVinci, and many others.

However, just 'cuz one can keep your colors inside the lines, that doesn't necessarily make one an artist. After all, the lines were already there.

OK... done with my rant for today.

Now, your question...
"I am looking for a conversion program to create G Code (for an old GE Fanuc 10T CNC). I am hoping for something that will run on a PC and go from conversational to G Code. We would then manually input the G code."

INTERESTING! (At least, as posed)

Now, I suspect (that is, I'm pretty sure) that you have mis-spoken in there somewhere. But, none the less, the question, as posed, is very interesting - because I have an answer to the question - "as posed".

Now, according to the question, as posed, you want "conversational code" that will generate G-Code for an old GE.

Then, it appears that you will then MANUALLY enter G-Code as you know it now.

The purpose of the PC Program being to present "Conversational Language" to some kind of HMI or whatever, at which point the PC Program solicites G-Code information from you.

That is, the PC Program asks for specific data using English phrases and then the program converts your entries to old-G-code.

This can be accomplished using "C" (my favorite) or VisualBasic or Fortran or Cobol or Pascal or LISP or ...

If this is the case, then you need someone that knows one of these languages.

The program simply needs to "know" that it is soliciting data for a particular function-type.

Your program needs to "parse" the Command and the data.

Enter Command and Data according to a format that you determine. You need to have de-limiters to help the "parser" to determine the difference between a command and various pieces of data associated with the command.

For example,

GO TO: X=###, Y=###, Z=###, Speed=###, Rate=###

RADIUS: X=###, Y=###, r=###, X-INC=###, Y-INC=###, ARC_LEN=###

HOME: (in your program Home = X=###, Y=###, Z=###, or some such)

It's not nearly that simple but, that is the gist of it.

Pose an English question and assign the answer to a specific data-word as related to the particular question (command).

Once the data is all gathered, then build your old-G-code.

Remember, in this stuff, the order of the sequence is EVERYTHING!

(81)
 
Last edited:
Thank you Terry. Yes, my intent was to encourage you create a discourse.

Sometimes we stray from our comfort zone, this is one of those times. All I know is G code exists and is used for CNC programming.

Yes, I am looking for an interface that will step us through the programming using a "fill in the blank" format and pull down menues. Evidently this is common on newer generation CNC equipment.

In our area G code knowledge is going the way of Gregg shorthand. We hired an operator who helped us get the old CNC running, but he did not know how to generate code. He quit after 1 day to go somewhere that didn't require that much thought. The next hire knew the basics of codeing but he did not know all the commands and sequences by heart. He went to get a book from a friend and actually hasn't been seen since.

Our final action will probably be like Rick suggested, where we contract out the code generation for this one part. But, what about the next time? After all, when was the last time you believed "The machine/program/process will stay this way forever"?
 
If you contract out the initial programming, you will have a model to work with if the part changes. A command reference should be all you need.


Like all programming, G-code can be as complicated or simple as you want it to be. In it's simplest form it is fairly straightforward. It requires the same mind set that programming in old BASIC. If you want the program to be adaptable and adujustable, things get a little more complicated.

Here is an example of one company that makes programming packages.

http://www.microcimm.com

We have used their engraving product with some success.
 
Hmmm...

In general, the conversion process involves...

Solicit information in a "conversational manner"
Using that information, construct a command according to a particular format into pseudo-code.
When the coding is done, convert the pseudo-code into G-Code.

Now, it might be the case that there is "header data" associated with each executable file. You need to know if that is so and what those contents need to be.

Without a doubt, the first thing you need is a paper listing of the G-Codes used by your machine.

Each "complete code item" must include the Command and all of the required Parameters.

For example: GO TO: A, B, C, D, E,...
Where perhaps...
A = X-Dim
B = Y-Dim
C = Z-Dim
D = Cutter Rotational Speed
E = Cutter Translational Speed
...?

First, envision the process after the converter has been completed.

Somehow, the operator indicates to the program, "Let's build a sequence".

The screen comes back and says, "Fine, let's build a sequence."

Whoever builds the "sequence developer" has to have a sense of the sequence required to build a sequence. For example...

HEADER DATA?

DEFINE INITIAL FACTORS
Home Location
Limits
...?

DEFINE SEQUENCE

DEFINE FINISH ROUTINE?

It's not absolutely required but, there's a lot of benefit to be had by defining the Limits.

You "could" simply define the sequence. You could then bring the cutter-head to a particular location and say "GO". As long as all of your code is absolutely correct, then this will probably deliver the goods.

One way or another, you must have the complete sequence in mind, or better yet, on paper - in detail!

Soliciting Data in a "conversational manner":

Build a split-screen. One half shows the instructions as they have been developed and in the order that they were developed. The other half is used to develop instructions.

The "Code so far" portion of the screen shows each constructed command and its associated parameters.
Each Command and set of Parameters makes up a single line.

The "Code development" side of the screen provides a selection of functions:

New Command..... Build a new command code for addition to the "Code so far" list.
Save Command..... Add the newly completed command to the end of the list or the edited command
Edit Command..... Scroll through "Code so far", select command and edit
Delete Command
Insert Command
Cancel Command
Open Sequence
Save Sequence

When you select New Command, either a menu of all commands is displayed or a menu of menus is displayed.

In either case, you eventually get to the point where you select the particular command that you want to construct. Once a new command is selected, the screen displays the command and a list of the required parameters. The operator then enters the appropriate data, using the appropriate units, for each parameter.

Once the parameters are all entered then the operator selects Save Command.

Now, before the program appends the new command to the list of "Code so far", it would be a good thing for the program to look for obvious violations of limits.

Of course, the sequence doesn't know what it is trying to make and, in general, can not tell you that a particular parameter entry is wrong. However, there can be a defined set of limits that the sequence must operate within.

For example, it simply would not do to tell the cutting-head to move 2 feet beyond its physical limit. If the physical limits of the procedure are defined at an early stage of the command development process then the program can at least indicate when you are trying to exceed the physical limits.

You might also be able to determine and indicate some areas of the work-piece that are absolutely out-of-bounds to the sequence. If any command violates one of those areas then the program might indicate that the move violates a boundary. It should then indicate how and why.

If the program does not find any obvious violations then the new command is added to the end of the list of commands on the "Code so far" part of the screen.

TANGENT:

When you think about it, machining a part is an interesting concept. It's not so much "building something" as much as it is "unbuilding something".

It's like the sculptor that is carving an elephant from a huge block of rock. How does he do it? He carves away everything that DOES NOT look like an elephant!

Machining is the same thing. Starting with a block of metal, the machining process takes away everything that DOES NOT look like a widget!

What something "IS" can be equally defined by what it "IS NOT". This works best within a limited set of extremes.

END TANGENT:

The "Code so far" display should show the command and parameters in a way that is clearly obvious.

The "name" of the command should be indicated using, at least, an easily recognized acronym, if not the full name. The parameters should be separated by any convienient delimiter. Use whatever arrangement that will display the entire command and parameters on one line.

The list of "Code so far" should look the same as the code you have written on paper.

The Edit Command function should allow you to scroll up and down through the list of "Code so far". Once you have highlighted the code you want to edit, press Enter and that command with its previously saved parameters is displayed. Then TAB through the fields making changes as necessary. When the edit is done, then select Save Command.

Once you have completed the sequence, Save Sequence.

If this particular sequence is an edited version of an existing sequence then you should have the option to overwrite the previous version or "Save As..."

Then you need to have a way to compile the particular sequence into the code recognized by the machine.

You have to build a "parser" that will read the commands as you have saved them and then convert each command with parameters into the specific format that the machine will recognize.


The paper listing of the G-Code Commands must give an indication of the precise format of the Command and the Parameter Structure as used by the machine. It would be great if you had a copy of an old source program just so you could see exactly what the machine expects. You will also need to know what is being used as the "delimiter" between the various parameters. Typical delimiters between parameters include "comma", "semi-colon", "slash", a "space", or possibly some combination. Typical delimiters between command-lines include "Carriage Return", " Carriage Return - Line Feed", "Form Feed", "End-of-Line", or...?

Command: A,B,C,... (delimiter is "comma")
Command: A, B, C,... (delimiter is "comma" and "space")
Command: A;B;C;... (delimiter is "semi-colon")
Command: A/B/C... (delimiter is "slash")
Command: A B C... (delimiter is "space")

You then have to go through the effort of parsing your commands and constructing the final G-Code.

Easy stuff? Well... maybe.

The converter should be a small general-purpose parser. As long as the "conversational version" is developed in a consistent manner then the conversion process should be pretty simple and straight forward.

Conversational Version: Move To: X = 2.345, Y = 6.332, Z = 0.000
G-Code Version: GO_TO: 2.345 6.332 0.000

Your "parser" would read the line, grabbing and holding characters on a character-by-character basis while looking for the "colon". The parser builds a string. Once the colon is found, the "parser" would use the string thus far and go through a list of your command names looking for the corresponding G-Code name. Your list might include Move To = GO_TO. Once found, the G-Code name, GO_TO, is written to a "scratch area".

So far... GO_TO:

Next, the "parser" continues reading your code line looking for an equal sign followed by a space. When that is found, the "parser" then continues reading your line, grabbing and holding the characters, again, character-by-character, until the "parser" sees a "comma" or "end-of-line". The "parser" "pre-pends" a space onto the front of those characters and drops the comma from the end. Those characters are added to the "So far..." string.

So far... GO_TO: 2.345

The "parser" repeats the last step...

So far... GO_TO: 2.345 6.332

So far... GO_TO: 2.345 6.332 0.000

In the last case, the "parser" ran into an "end-of-line" character instead of a "comma". As such, the "parser" knows that was the last parameter. The "parser" then copies the completed data to the next line in the G-Code file. The "parser" then goes for the next line of code.

The finalized version of the line of code then looks exactly like it would if you used the original G-Code data entry scheme.

In general, "parsers" are pretty easy to develop. The hard part is determining unambiguous formatting for the source, and that formatting needs to be rigidly formalized.

There are only a few billion different ways of doing this.

This "plan" is far short of everything that you need to take into account. However, it might give you a place to start from. Creating your own interface program can be a real kick in the a$$. The neat part is that you can have this do exactly what you want... with no artificial limitations.




(155)
 
Jim,

If you have a lot of time on your hands and want to figure out how to develop an interface from scratch... you can try as I suggested.

However, after looking at the site that Bob indicated, Kentech seems to have what you need. Their interface is just what I had in mind.

However, you said...

"I am looking for a conversion program to create G Code (for an old GE Fanuc 10T CNC). I am hoping for something that will run on a PC and go from conversational to G Code. We would then manually input the G code."

Kentech indicates that they can produce G-Code that can be used in Fanuc. You indicate that you have an "old" GE Fanuc 10T CNC. I don't know how old that is. But I do know that "languages" have a way of changing over time. There might be some compatibility issues between new-G and old-G.

But then, Kentech says, "Wait! There's more!"

They indicate that they have a converter that can be used to perform special conversions. For example, if their G-Code producer outputs a particular new G-Code function that the 10T won't recognize, then you can apply a custom conversion that will convert the new G-Code to the older version. Sounds simple... but...

I suggest that you talk to Kentech and see what they have to say. I should think they would know what version of the G-Code language the 10T understands.

If they don't know, maybe Steve Bailey has some idea.

I'll bet that this is a one-time job. As such, the idea of spending about a grand on software for a one-time job doesn't sound too appealing. If so... then find a list of the applicable G-Code and get a "C" or "VB" programmer.

(208)
 
master cam?

I'm just curious, you would like to input data and have it turned into g-code? not sure what your application is but most of the machines we buy come with a cam program, mori seiki, hurco....., but we also have a program called Master Cam, which we use for genertating g- code from a drawing and tool path description, would you be able to use something like this rather than creating your own?
I'm just asking, because i think it would more cost effective to do this than creating a program from scratch, or perhaps you like tha challenge?
Best Regards
 
A little more info.

The AC servo CNC is from the late 70's maybe early 80's. Who knows if the tape drive even works?

My customer needs to produce about 5000 parts per year. The process is to bore a hole into an aluminum part, chamfer the edges of the hole, and remove the saw marks from both faces.

I am sure the end customer has some type of CAD but all my customer has a printed drawing.

I will be downloading some of the suggested demo programs.
 
Jim,
What machine?
Serial tape replacements are available at Omega EBR.
DON'T forget the 'M' codes (machine specific special codes)

I know 2 companies that sell the soft you want - MasterCam is $$$$$$$$$$

Rod (The CNC dude)
 

Similar Topics

Hi All, Can anyone advise me on how to determine the AN of a genie instance I writing to. I have created a genie to display a valve and some text...
Replies
0
Views
81
Hi I have been knocking my head against the wall trying to figure out why these two plcs won't talk with Produced and Consumed Tags data. The...
Replies
14
Views
417
Hello Everyone. Looking to see if any of you have encountered an issue with these drives. We have a major installation with around 30 of these...
Replies
0
Views
59
Error description: "A connection could not be established in the open process of the TCP connection." Action: •Check the operation of the...
Replies
3
Views
100
I am trying to display a variable within a cicode function onto a graphics page. This function queries a SQL database. I can get the value onto a...
Replies
3
Views
229
Back
Top Bottom