Topics

A quick programming question.... #development

Patrick Ferrick
 

Hi again-

In trying to understand what's going on internally (ie. in pcb-gcode.ulp specifically), I keep running into things like the following:

rz(DEFAULT_Z_UP);
rxy(rx1, ry1);
fzr(z_down_or_radius, fr_z);
fxyr(rx2, ry2, fr_xy);

A check of the Eagle docs shows that rz(), rxy(), fzr() and others are NOT built-in functions, so they must be defined somewhere in the code...but I'll be darned if I can figure out where! 
I would guess that rz() might be 'retract z' but it sure would be handy to be able to take a look at the actual code.

[Probably a textbook case of a little (programming) knowledge being a very dangerous thing, but I guess if I don't ask it may take quite a while to figure it out!]

I'm getting fairly close to having things adjusted so that my linuxcnc machine can use the drill file....

tnx,
Pat



John Johnson
 
Edited

You'll find all those definitions in the source/ directory. You can use grep or other text search utilities to find the file a function is defined in.

rz() means rapid move in Z, rxy() means rapid move in xy, etc.

fz() means feed move in Z, fxy() means feed move in xy, etc.

Some of the other definitions are a little more obscure, and are to get around limitations in EAGLE's language, such as frrr(), which is a format command (like sprintf()) that takes three real (r) arguments, thus frrr = format real real real.

As stated before, more than likely there's a way to do what you want without getting into the code (although I like knowing how things work too).

Patrick Ferrick
 

Thanks very much for the details, John.   I did eventually find those functions, and with only a little bit of commenting the ulp here and there, and a whole bunch of user-gcode I now have everything just about the way I want it.  Plus I have a MUCH better idea of how everything ties together.  

Thanks again for such an elaborate and useful piece of software!

Patrick


On Thu, May 21, 2020 at 2:18 PM John Johnson <john@...> wrote:

You'll find all those definitions in the source/ directory. You can use grep or other text search utilities to find the file a function is defined in. rz() means rapid move in Z, rxy() means rapid move in xy, etc. fz() means feed move in Z, fxy() means feed move in xy, etc. Some of the other definitions are a little more obscure, and are to get around limitations in EAGLE's language, such as frrr(), which is a format command (like sprintf()) that takes three real (r) arguments, thus frrr = format real real real.

As stated before, more than likely there's a way to do what you want without getting into the code (although I like knowing how things work too).

Attachments: