PGM and XXL: two views of one program

A PGM is not a different program from its XXL listing. It is the same program written as records the controller can load directly, which is why it can be read back.

The same program, written twice

A Xilog listing and the PGM compiled from it hold the same commands in the same order. The listing spells them out for a person; the file states each one as a command number, the length of its fields and which of those fields are present. Reading a PGM back is a matter of naming the commands again, not of guessing what the machine was doing.

What comes back exactly

Coordinates, depths, feeds, spindle sets, tooling file names and comments all survive, because each is a field the record carries. All 116 reference programs decompile to the text they were compiled from, character for character, which is what tells us the reading is right rather than merely plausible.

What does not come back

Anything the compiler worked out and threw away. Variables and expressions are resolved to numbers before the file is written, so a program that said the length minus fifty comes back as the number. Blank lines, indentation and the order of parameters on a line are the compiler's choices, not the program's.

The dialect you get

The text is the dialect the compiled file belongs to: values written with an equals sign, as in X=492.92, and feeds as the controller's classes V1 to V9 rather than millimetres per minute. That is what the machine's own tooling produced, and it is what its editor expects back.

Why read one at all

Usually because the source is gone: the machine has the program, the office does not. A readable listing is also the only practical way to see what a file on a machine actually does before you run it, to compare two files, or to keep a record that survives the controller.