Page 1 of 1

how to get line number in lxcnc postprocessor

Posted: Sun Oct 07, 2018 7:35 pm
by jamby
I would like to get line number in the output of the Lxcnc [in] postprocessor. How is this done.

Thanks
Jim

Re: how to get line number in lxcnc postprocessor

Posted: Mon Oct 08, 2018 9:51 am
by andrew
You'd have to create your own post processor, e.g. "MyLxcncIn.js" and add the number ([N]) to the front of each g-code line. For example:

Code: Select all

include("LxcncIn.js");

function MyLxcncIn(documentInterface, camDocumentInterface) {
    LxcncIn.call(this, documentInterface, camDocumentInterface);

    this.header = [
        "%",
        "[N] ( CREATED WITH QCAD-CAM  )",
        "[N] (     FILE PATH: [FILEPATH])",
        "[N] (     FILE NAME: [FILENAME])",
        "[N] (     DATE/TIME: [DATE_TIME])",
        "[N] (    CUTTER NUM: [T])",
        "[N] (    CUTTER DIA: [TD])",
        "[N] (    CUTTER NOTES: [PROGRAM_NAME])",
        "[N] G20 G17 G40 G49 G54 G80 G90 G94",
        "[N] G64 P0.001"  // tighten tolerance
    ];

    this.footer = [
      "[N] M02",
      "[N] %"
    ];

    this.toolHeader = [
        "[N] M6 [T]"
    ];

    this.rapidMove =                 "[N] G0 [X] [Y]";
    this.rapidMoveZ =                "[N] G0 [Z]";

    this.firstLinearMove =           "[N] G1 [X] [Y] [F]";
    this.firstLinearMoveZ =          "[N] G1 [Z] [F]";
    this.linearMove =                "[N] [X] [Y] [F]";
    this.linearMoveZ =               "[N] [Z] [F]";

    this.firstArcCWMove =            "[N] G2 [X] [Y] [I] [J] [F]";
    this.arcCWMove =                 "[N] G2 [X] [Y] [I] [J] [F]";

    this.firstArcCCWMove =           "[N] G3 [X] [Y] [I] [J] [F]";
    this.arcCCWMove =                "[N] G3 [X] [Y] [I] [J] [F]";
    this.linearMoveCompensationLeft = [
        "[N] [F!]",
        "[N] G41 [X] [Y]"
    ];

    this.linearMoveCompensationRight = [
        "[N] [F!]",
        "[N] G42 [X] [Y]"
    ];
    this.linearMoveCompensationOff = [
        "[N] G40",
        "[N] G1 [X] [Y]"
    ];

}

MyLxcncIn.prototype = new LxcncIn();
MyLxcncIn.displayName = "My Lxcnc [in]";

Re: how to get line number in lxcnc postprocessor

Posted: Mon Oct 08, 2018 4:33 pm
by jamby
Thank you
Jim