how to get line number in lxcnc postprocessor

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
jamby
Full Member
Posts: 55
Joined: Fri Jun 24, 2016 2:41 pm

how to get line number in lxcnc postprocessor

Post by jamby » Sun Oct 07, 2018 7:35 pm

I would like to get line number in the output of the Lxcnc [in] postprocessor. How is this done.

Thanks
Jim

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: how to get line number in lxcnc postprocessor

Post by andrew » Mon Oct 08, 2018 9:51 am

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]";

jamby
Full Member
Posts: 55
Joined: Fri Jun 24, 2016 2:41 pm

Re: how to get line number in lxcnc postprocessor

Post by jamby » Mon Oct 08, 2018 4:33 pm

Thank you
Jim

Post Reply

Return to “QCAD/CAM”