586,036 active members*
3,656 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > PlanetCNC > Issues with post processor and new torch height
Page 1 of 2 12
Results 1 to 20 of 21
  1. #1
    Join Date
    Aug 2022
    Posts
    23

    Issues with post processor and new torch height

    Hi there,
    i set up today my new system to measure the height of the plasma table by 3 induction switches. It workes so far, but now i want to use it in a GCode to cut smth. Sheetcam has a PlanetCNC with THC and Floating Head.
    I'd like to modify it to use it with my table but i have no clue how to do that cause i don't know all the Codes. When i try it without a Gcode and click the "Measure work height" it sets to the right height - so i assume i should take the code behind this button and put it in the code. But what code is it?


    When i try to load the GCode with this processor the TNG says:
    |!|b|iGCode Error:
    |! Line:8 G38.9 Z#<_sensor_thick>
    |! //home/benedict/Schreibtisch/Anschweißlasche 45x30x8.tap
    |!|i Unknown G-code 'G38.9'

    Error in G-Code!



    Thats the initial code:

    function OnInit()
    post.Text ("(Filename: ", fileName, ")\n")
    post.Text ("(Post processor: ", postName, ")\n")
    post.Text ("(Date: ", date, ")\n")
    post.Eol()

    post.Text ("o<measure> sub\n")
    post.Text (" M73\n")
    post.Text (" #<z> = #<_z>\n")
    post.Text (" F#<_speed_probe>\n")
    post.Text (" G38.9 Z#<_sensor_thick>\n")
    post.Text (" G38.2 Z-1000\n")
    post.Text (" G92 Z#<_sensor_thick>\n")
    post.Text (" G00 Z#<z>\n")
    post.Text ("o<measure> endsub\n")

    Am i right taking the G-Code G38.9 and replace it with the right one?

  2. #2
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    I have been trying with some other guys on a german forum and got it managed to work. Nearly. It stops after the secound measure routine.

    Heres the post processor:
    Code:
    --  version 29/8/2017
    
    function OnAbout(event)
       ctrl = event:GetTextCtrl()
       ctrl:AppendText("PlanetCNC Plasma+THC+Höhenmessung\n")
    end
    
    function OnNewLine()
    
    end
    
    function OnInit()
       post.Text ("(Filename: ", fileName, ")\n")
       post.Text ("(Post processor: ", postName, ")\n")
       post.Text ("(Date: ", date, ")\n")
       post.Eol()
    
       post.Text ("o<measure> sub\n")
     
     
       post.Text ("G65 P120 R1\n")
       post.Text ("M2\n")
       post.Text ("o<measure> endsub\n")
    
       
       
       if(scale == metric) then
          post.Text ("G21 (Units: Metric)\n") --metric mode
       else
          post.Text ("G20 (Units: Inches)\n") --inch mode
       end
       post.Text ("G90 (Distance Mode: Absolute)\n")
       post.Text ("G91.1 (Distance Mode IJK: Incremental)\n")
       post.Text ("G94 (Feed Rate Mode: Units per Minute)\n") 
       post.Eol()
       
       post.ModalText ("G00")
       post.ModalNumber (" Z", (safeZ + toolOffset) * scale, "0.0000")
       post.Eol()
       
       bigArcs = 1 --stitch arc segments together
       minArcSize = 0.05 --arcs smaller than this are converted to moves
    end
    
    function OnFinish()
       post.Text ("M02\n")
    end
    
    function OnRapid()
       post.ModalText ("G00")
       post.ModalNumber (" X", endX * scale, "0.0000")
       post.ModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.Eol()
    end
    
    function OnMove()
       post.ModalText ("G01")
       post.ModalNumber (" X", endX * scale, "0.0000")
       post.ModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.ModalNumber (" F", feedRate * scale, "0.0###")
       post.Eol()
    end
    
    function OnArc()
       if(arcAngle < 0) then
          post.ModalText ("G03")
       else
          post.ModalText ("G02")
       end
       post.NonModalNumber (" X", endX * scale, "0.0000")
       post.NonModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.Text (" I")
       post.Number ((arcCentreX - currentX) * scale, "0.0000")
       post.Text (" J")
       post.Number ((arcCentreY - currentY) * scale, "0.0000")
       post.ModalNumber (" F", feedRate * scale, "0.0###")
       post.Eol()
    end
    
    
    function OnPenDown()
       post.Text ("o<measure> call\n")
          
       post.CancelModalText()
       post.CancelModalNumbers()
        
       post.ModalText ("G00")
       post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
       post.Eol()
       
       post.Text ("M03\n")
       if (pierceDelay > 0.001) then
          post.Text ("G04 P")
          post.Number (pierceDelay,"0.0###")
          post.Eol()
       end
       
       post.ModalText ("G01")
       post.ModalNumber (" Z", cutHeight * scale, "0.0000")
       post.ModalNumber (" F", plungeRate * scale, "0.0###")
       post.Eol()
       
       post.Text ("M54 P1\n")
    end
    
    function OnPenUp()
       post.Text ("M54 P0\n")
       
       post.Text ("M05\n")
       if (endDelay > 0) then
          post.Text ("G04 P")
          post.Number (endDelay,"0.0###")
          post.Eol()
       end
       
       post.ModalText ("G00")
       post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
    end
    
    function OnNewPart()
       post.Text ("(Part: ",partName,")\n");
    end
    
    function OnNewOperation()
       post.Text ("(Operation: ", operationName, ")\n")
    end
    
    function OnComment()
      post.Text ("(",commentText,")\n")
    end
    And heres what comes out as GCode:
    Code:
    (Filename: Anschweißlasche 45x30x8.tap)
    (Post processor: PlanetCNC plasma THC (floating Z)_NEU3.scpost)
    (Date: 17.10.2022)
    o<measure> sub
    G65 P120 R1
    M2
    o<measure> return
    G21 (Units: Metric)
    G90 (Distance Mode: Absolute)
    G91.1 (Distance Mode IJK: Incremental)
    G94 (Feed Rate Mode: Units per Minute)
    G00 Z10.0000
    (Part: Anschweißlasche 45x30x8)
    (Operation: Außen Versatz, 0, T5: Stahl - 3,0 mm - 40 Ampere - 1,0 mm_Fertig)
    G00
     X39.0228 Y15.6890
    o<measure> call
    G00 Z5.0000
    M03
    G04 P1.0
    G01 Z1.0000 F3810.0
    M54 P1
     X39.0228 Y15.6890
    G02 X35.0000 Y9.6685 I-5.0216 J-0.9989 F2249.9999
    G01 X33.0000
     X13.5000 F3000.0
     X12.5000 F2249.9999
    G02 X7.3450 Y13.9245 I0.0000 J5.2500
     X12.5000 Y20.1685 I5.1550 J0.9940 F1500.0
    G01 X14.5000
     X34.0000 F3000.0
     X35.0000 F2249.9999
    G02 X40.1550 Y15.9125 I0.0000 J-5.2500
     X35.0000 Y9.6685 I-5.1550 J-0.9940 F1500.0
     X32.4400 Y12.2285 I0.0000 J2.5600
    M54 P0
    M05
    G00 Z10.0000
     X50.6200 Y2.8800
    o<measure> call
    G00 Z5.0000
    M03
    G04 P1.0
    G01 Z1.0000 F3810.0
    M54 P1
     X50.6200 Y2.8800
    G02 X45.5000 Y8.0000 I0.0000 J5.1200 F2249.9999
    G01 Y10.0000
     Y21.0000 F3000.0
     Y22.0000 F2249.9999
    G03 X37.0000 Y30.5000 I-8.5000 J-0.0000
    G01 X35.0000
     X-1.0075 F3000.0
     X-2.0075 F2249.9999
    G02 X-0.5000 Y32.0075 I0.0000 J1.5075
    G01 Y28.0000
     Y-1.0075 F3000.0
     Y-2.0075 F2249.9999
    G02 X-2.0075 Y-0.5000 I-1.5075 J0.0000
    G01 X2.0000
     X36.0000 F3000.0
     X37.0000 F2249.9999
    G03 X45.4412 Y7.0023 I0.0000 J8.5000
     X45.5000 Y8.0000 I-8.4412 J0.9977
    G02 X48.0600 Y10.5600 I2.5600 J-0.0000
    M54 P0
    M05
    G00 Z10.0000
    M02
    It measures the first time, then i goes to the destination XY, goes to Z10 as it should and it measures as it should. But after the measure it stops. Any ideas on how to fix that? I've come so far with that but it seems to be only one small thing.

  3. #3
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    Ok, nevermind. I found the issue. It was the M2-Order in the measure-sub. It ends the whole program and not only the sub.

    But theres one thing left: Why can't i see the workpaths? With the old post i can see everything but the new one doesn't show me anything.
    I compared both processors. They got the same codes in it, but why doesn't it show me something?

  4. #4
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    Postprocessor for Sheetcam is included in Samples folder in TNG installation. There are 3 versions available - one for standard machines, one for machines with THC and for tangential cutters.
    I believe they all work without problems.

  5. #5
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    I downloaded the TNG for Linux again and looked in the Samples Folder. I can't see any posts there. How is it called?

  6. #6
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    Here are all sample files:
    https://planet-cnc.com/wp-content/up...NC_Samples.zip

    It seems that Linux distro does not include all of them.

  7. #7
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    None of those post-processors work for me. I need one with a Z-Axis Probe. My own processor works now. But still without being able to see the workpaths.

  8. #8
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    PlanetCNC Plasma THC.scpost post measures Z before cutting.

  9. #9
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    No, it doesn't. It goes straight to the pierce and then to the cutting height.

    I found the problem with the displaying of the paths: When i disclaim the G-Code for the measuring, the lines appear. It seems, the G65 is in conflict with the displaying of the lines. When i put this code in G65 P120 R1 the lines dissapear, and with the brackets (G65 P120 R1) it seems fine, it doesn't measure tho. Whats the matter with that?

  10. #10
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    When G65 is processed for display, measurements are invalid. Tool position is at invalid coordinates and can not be displayed.

    If you look how O110 is made - all measurements are cleared and if not ACTIVE sub is exited.
    O120 sets working offset only if O110 made valid measurement.

    Send me your g-code. I'll check why toolpath is not shown in your case.

  11. #11
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    Thats the GCode of a simple part. It works, but the paths are not shown.

    Code:
    (Filename: Anschweißlasche 45x30x8.tap)
    (Post processor: PlanetCNC plasma THC (floating Z)_NEU4.scpost)
    (Date: 17.10.2022)
    o<measure> sub
    G65 P120 R1
    o<measure> endsub
    G21 (Units: Metric)
    G90 (Distance Mode: Absolute)
    G91.1 (Distance Mode IJK: Incremental)
    G94 (Feed Rate Mode: Units per Minute)
    G00 Z10.0000
    (Part: Anschweißlasche 45x30x8)
    (Operation: Außen Versatz, 0, T5: Stahl - 3,0 mm - 40 Ampere - 1,0 mm_Fertig)
    G00
     X39.0228 Y15.6890
    o<measure> call
    G00 Z5.0000
    M03
    G04 P1.0
    G01 Z1.0000 F3810.0
    M54 P1
     X39.0228 Y15.6890
    G02 X35.0000 Y9.6685 I-5.0216 J-0.9989 F2249.9999
    G01 X33.0000
     X13.5000 F3000.0
     X12.5000 F2249.9999
    G02 X7.3450 Y13.9245 I0.0000 J5.2500
     X12.5000 Y20.1685 I5.1550 J0.9940 F1500.0
    G01 X14.5000
     X34.0000 F3000.0
     X35.0000 F2249.9999
    G02 X40.1550 Y15.9125 I0.0000 J-5.2500
     X35.0000 Y9.6685 I-5.1550 J-0.9940 F1500.0
     X32.4400 Y12.2285 I0.0000 J2.5600
    M54 P0
    M05
    G00 Z10.0000
     X50.6200 Y2.8800
    o<measure> call
    G00 Z5.0000
    M03
    G04 P1.0
    G01 Z1.0000 F3810.0
    M54 P1
     X50.6200 Y2.8800
    G02 X45.5000 Y8.0000 I0.0000 J5.1200 F2249.9999
    G01 Y10.0000
     Y21.0000 F3000.0
     Y22.0000 F2249.9999
    G03 X37.0000 Y30.5000 I-8.5000 J-0.0000
    G01 X35.0000
     X-1.0075 F3000.0
     X-2.0075 F2249.9999
    G02 X-0.5000 Y32.0075 I0.0000 J1.5075
    G01 Y28.0000
     Y-1.0075 F3000.0
     Y-2.0075 F2249.9999
    G02 X-2.0075 Y-0.5000 I-1.5075 J0.0000
    G01 X2.0000
     X36.0000 F3000.0
     X37.0000 F2249.9999
    G03 X45.4412 Y7.0023 I0.0000 J8.5000
     X45.5000 Y8.0000 I-8.4412 J0.9977
    G02 X48.0600 Y10.5600 I2.5600 J-0.0000
    M54 P0
    M05
    G00 Z10.0000
    M02

  12. #12
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    Edit O120 script and add lines
    Code:
    o<chk> if[LNOT[ACTIVE[]]]
      M99
    o<chk> endif
    after first line (o120)

  13. #13
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    I have no clue rn where i should add these lines. In the Post there are no O-Words.

    Code:
    --  version 29/08/2017
    --  version 16/12/2019 - modified for TNGv2
    --  version 15/04/2021 - modified for multiple part support
    
    function OnAbout(event)
       ctrl = event:GetTextCtrl()
       ctrl:AppendText("PlanetCNC Plasma THC\n")
    end
    
    function OnNewLine()
    
    end
    
    bigArcs = 1 --stitch arc segments together
    minArcSize = 0.05 --arcs smaller than this are converted to moves
    post.SetOptions(post.DISABLE_TOOLCHANGE + post.ARC_SEGMENTS)
    
    _newPart = false
    
    function OnInit()
       _newPart = false
    
       post.Text ("(Job: ",fileNameOnly,")\n")
       if(scale == metric) then
          post.Text ("G21") 
       else
          post.Text ("G20") 
       end
       post.Text (" G90")  
       post.Text (" G91.1")
       post.Text (" G94") 
       post.Text (" G49") 
       post.Eol()
       
       post.Text ("G00")
       post.NonModalNumber (" Z", safeZ * scale, "0.0000")
       post.Eol()
    end
    
    function OnFinish()
       post.Text ("M02\n\n")
       post.Eol()
        
       post.Text ("o<measure> sub\n")
       post.Text ("  M73\n")
       post.Text ("  M50P0 ;disable speed override\n")
       post.Text ("  M55P0 ;disable trans\n")
       post.Text ("  M56P0 ;disable warp\n")
       post.Text ("  M57P0 ;disable swap\n")
       post.Text ("  M10P1 ;motor enable\n")
       post.Text ("  M11P1 ;limits/probe enable\n")
       post.Text ("\n")
       
       post.Text ("  #<z> = #<_z>\n")
       post.Text ("  M11P0 G38.2 Z-1000 F#<_tooloff_speed>\n")
       post.Text ("  G91 G01 Z[+#<_tooloff_swdist>]\n")
       post.Text ("  o<low> if [#<_tooloff_speed_low> GT 0]\n")
       post.Text ("    G90 G38.2 Z-100000 F#<_tooloff_speed_low>\n")
       post.Text ("    G91 G01 Z[+#<_tooloff_swdist>] F#<_tooloff_speed>\n")
       post.Text ("  o<low> endif\n")
       post.Text ("  M11P1 G90\n")
       post.Text ("\n")
       
       post.Text ("  o<chk> if[NOTEXISTS[#<_probe_z>]]\n")
       post.Text ("    (msg,Measuring failed)\n")
       post.Text ("    M2\n")
       post.Text ("  o<chk> endif\n")
       post.Text ("\n")
       
       post.Text ("  G43.1 Z[#<_probe_z> - #<_tooloff_sensorz> - #<_workoff_z>]\n")
       post.Text ("\n")
       post.Text ("  M72\n")
       post.Text ("  M71\n")
       post.Text ("  G43.1\n")
       post.Text ("\n")   
       
       post.Text ("  G00 Z#<z>\n")
       post.Text ("o<measure> endsub\n")
       post.Eol()
    end
    
    function OnNewPart()
      _newPart = true
    end
    
    function OnNewOperation()
       --post.Text ("(Operation: ", operationName, ")\n")
    end
    
    function OnComment()
      post.Text ("(",commentText,")\n")
    end
    
    
    function OnRapid()
       if ((currentX ~= endX) or (currentY ~= endY)) then
         post.Text ("G00")
         post.ModalNumber (" X", endX * scale, "0.0000")
         post.ModalNumber (" Y", endY * scale, "0.0000")
         post.Eol()
       end
    end
    
    function OnMove()
       if ((currentX ~= endX) or (currentY ~= endY)) then
         post.Text ("G01")
         post.NonModalNumber (" X", endX * scale, "0.0000")
         post.NonModalNumber (" Y", endY * scale, "0.0000")
         post.ModalNumber (" F", feedRate * scale, "0.0###")
         post.Eol()
       end
    end
    
    function OnArc()
       if (arcAngle < 0) then
          post.Text ("G03")
       else
          post.Text ("G02")
       end
       post.NonModalNumber (" X", endX * scale, "0.0000")
       post.NonModalNumber (" Y", endY * scale, "0.0000")
       post.Text (" I")
       post.Number ((arcCentreX - currentX) * scale, "0.0000")
       post.Text (" J")
       post.Number ((arcCentreY - currentY) * scale, "0.0000")
       post.ModalNumber (" F", feedRate * scale, "0.0###")
       post.Eol()
    end
    
    function OnSetFeed()
       --post.ModalNumber ("F", feedRate * scale, "0.0###")
       --post.Eol()
    end
    
    function OnToolChange()
    
    end
    
    function OnSpindleChanged()
    
    end
    
    function OnSpindleCW()
    
    end
    
    function OnSpindleCCW()
    
    end
    
    function OnSpindleOff()
    
    end
    
    function OnFloodOn()
       post.Text ("M8")
       post.Eol()
    end
    
    function OnMistOn()
       post.Text ("M7")
       post.Eol()
    end
    
    function OnCoolantOff()
       post.Text ("M9")
       post.Eol()
    end
    
    function OnPenDown()
       if (_newPart) then
          _newPart = false
          post.Text ("\n")
          post.Text ("(Part: ",partName,")\n")
          post.Text ("(Filename: ", fileName, ")\n")
          post.Text ("(Post processor: ", postName, ")\n")
          post.Text ("(Date: ", date, ")\n")
          post.Eol()
       end
       
       post.Text ("o<act> if [ACTIVE[]]\n")
       post.Text ("  o<measure> call\n")
       post.Text ("o<act> endif\n")
       post.Eol()
       
       post.CancelModalText()
       post.CancelModalNumbers()
        
       post.Text ("G00")
       post.NonModalNumber (" Z", pierceHeight * scale, "0.0000")
       post.Eol()
       
       post.Text ("M03")
       post.Eol()
       
       if (pierceDelay > 0.001) then
          post.Text ("G04 P")
          post.Number (pierceDelay, "0.0###")
          post.Eol()
       end
       
       post.Text ("G01")
       post.NonModalNumber (" Z", cutHeight * scale, "0.0000")
       post.NonModalNumber (" F", plungeRate * scale, "0.0###")
       post.Eol()
       
       post.Text ("M54 P1")
       post.Eol()
    end
    
    function OnPenUp()
       post.Text ("M54 P0")
       post.Eol()
       
       post.Text ("M05")
       post.Eol()
       
       if (endDelay > 0) then
          post.Text ("G04 P")
          post.Number (endDelay, "0.0###")
          post.Eol()
       end
       
       post.Text ("G00")
       post.NonModalNumber (" Z", safeZ * scale, "0.0000")
       post.Eol()
    end
    Thats your code THC-Post or do you mean my own?

  14. #14
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    You can do it also like this:
    Code:
    o<measure> sub
    o<act> if [ACTIVE[]]
      G65 P120 R1
    o<act> endif
    o<measure> endsub

  15. #15
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    Thats how it looks now:
    Code:
    function OnInit()
       post.Text ("(Filename: ", fileName, ")\n")
       post.Text ("(Post processor: ", postName, ")\n")
       post.Text ("(Date: ", date, ")\n")
       post.Eol()
       post.Text ("o<measure> sub\n")
       post.Text ("if [ACTIVE[]]\n")
       post.Text ("G65 P120 R1\n")
       post.Text ("endif\n")
       post.Text ("o<measure> endsub\n")
    Still no display of the paths.
    Or should i do a extra script somehow and delete the measure-code in the post?

  16. #16
    Join Date
    Aug 2020
    Posts
    131

    Re: Issues with post processor and new torch height

    Planet CNC is talking about the Measurement Script in TNG. NOT about changes in the Post Processor as far as I can tell.

    Go to:
    Settings->Programm Options->Scripts->O-Macro
    Select o120
    Press Edit
    Paste the mentioned code into line 2
    Press the Save button on the Left Side
    Close the window

  17. #17
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    Ok, i pasted the code like this into O120:
    Code:
    o120 ;Measure Work Offset
    o<measure> sub
    o<act> if [ACTIVE[]]
      G65 P120 R1
    o<act> endif
    o<measure> endsub
    
    #<_return> = NAN[]
    M73
    G08 G15 G90 G91.1 G90.2 G94
    M50P0
    M55P0
    M56P0
    M57P0
    M10P1
    
    o<chk> if[#<_workoff_useprobe>]
      G65 P110 H2 E-1 Q1 R1 D#<_probe_length> K#<_workoff_swdist> J#<_probe_sizez> F#<_probe_speed> I#<_probe_speed_low>
    o<chk> else
      G65 P110 H2 E-1 Q0 R1 D10000 K#<_workoff_swdist> J#<_workoff_size> F#<_workoff_speed> I#<_workoff_speed_low>
    o<chk> endif
    
    o<chk> if[NOTEXISTS[#<_return>] OR [#<_measure> EQ 0]]
      (msg,Measure Work Offset Measure error)
      M2
    o<chk> endif
    
    #<off> = #<_measure_z>
    o<chk> if[#<_tooloff> NE 0]
      #<off> = [#<off> - #<_tooloff_z>]
    o<chk> endif
    #<off> = [#<off> - #<_coordsys_z>]
    #<off> = [#<off> - #<_warp_offset>]
    
    o<chk> if[#<rvalue> EQ 1]
      G92.1 Z#<off>
    o<chk> endif
    
    #<_return> = #<off>
    M99
    Now i take the PlanetCNC THC Post and add somewhere a O120?

    Edit:
    Code:
    --  version 29/8/2017
    
    function OnAbout(event)
       ctrl = event:GetTextCtrl()
       ctrl:AppendText("PlanetCNC Plasma+THC+Höhenmessung\n")
    end
    
    function OnNewLine()
    
    end
    
    function OnInit()
       post.Text ("(Filename: ", fileName, ")\n")
       post.Text ("(Post processor: ", postName, ")\n")
       post.Text ("(Date: ", date, ")\n")
       post.Eol()
    
       
       if(scale == metric) then
          post.Text ("G21 (Units: Metric)\n") --metric mode
       else
          post.Text ("G20 (Units: Inches)\n") --inch mode
       end
       post.Text ("G90 (Distance Mode: Absolute)\n")
       post.Text ("G91.1 (Distance Mode IJK: Incremental)\n")
       post.Text ("G94 (Feed Rate Mode: Units per Minute)\n") 
       post.Eol()
       
       post.ModalText ("G00")
       post.ModalNumber (" Z", (safeZ + toolOffset) * scale, "0.0000")
       post.Eol()
       
       bigArcs = 1 --stitch arc segments together
       minArcSize = 0.05 --arcs smaller than this are converted to moves
    end
    
    function OnFinish()
       post.Text ("M02\n")
    end
    
    function OnRapid()
       post.ModalText ("G00")
       post.ModalNumber (" X", endX * scale, "0.0000")
       post.ModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.Eol()
    end
    
    function OnMove()
       post.ModalText ("G01")
       post.ModalNumber (" X", endX * scale, "0.0000")
       post.ModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.ModalNumber (" F", feedRate * scale, "0.0###")
       post.Eol()
    end
    
    function OnArc()
       if(arcAngle < 0) then
          post.ModalText ("G03")
       else
          post.ModalText ("G02")
       end
       post.NonModalNumber (" X", endX * scale, "0.0000")
       post.NonModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.Text (" I")
       post.Number ((arcCentreX - currentX) * scale, "0.0000")
       post.Text (" J")
       post.Number ((arcCentreY - currentY) * scale, "0.0000")
       post.ModalNumber (" F", feedRate * scale, "0.0###")
       post.Eol()
    end
    
    
    function OnPenDown()
       post.Text ("o<120> call\n")
          
       post.CancelModalText()
       post.CancelModalNumbers()
        
       post.ModalText ("G00")
       post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
       post.Eol()
       
       post.Text ("M03\n")
       if (pierceDelay > 0.001) then
          post.Text ("G04 P")
          post.Number (pierceDelay,"0.0###")
          post.Eol()
       end
       
       post.ModalText ("G01")
       post.ModalNumber (" Z", cutHeight * scale, "0.0000")
       post.ModalNumber (" F", plungeRate * scale, "0.0###")
       post.Eol()
       
       post.Text ("M54 P1\n")
    end
    
    function OnPenUp()
       post.Text ("M54 P0\n")
       
       post.Text ("M05\n")
       if (endDelay > 0) then
          post.Text ("G04 P")
          post.Number (endDelay,"0.0###")
          post.Eol()
       end
       
       post.ModalText ("G00")
       post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
    end
    
    function OnNewPart()
       post.Text ("(Part: ",partName,")\n");
    end
    
    function OnNewOperation()
       post.Text ("(Operation: ", operationName, ")\n")
    end
    
    function OnComment()
      post.Text ("(",commentText,")\n")
    end
    Thats my Post now. is that right?

  18. #18
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    Scorpion TDL post is one way to solve this. But I'll do this myself in version.
    Until then you can edit post like you did, but you mistyped. Read again my post. "If "statement is different.

  19. #19
    Join Date
    Aug 2022
    Posts
    23

    Re: Issues with post processor and new torch height

    I don't get it. I think i have to start from the beginning.

    Should i delete the code after the endif? It isn't necessary, right?

    How do i call the O120 Routine? The post doesnt work out.

  20. #20
    Join Date
    Mar 2017
    Posts
    1312

    Re: Issues with post processor and new torch height

    I edited your post.

    Code:
    --  version 29/8/2017
    
    
    function OnAbout(event)
       ctrl = event:GetTextCtrl()
       ctrl:AppendText("PlanetCNC Plasma+THC+Höhenmessung\n")
    end
    
    
    function OnNewLine()
    
    
    end
    
    
    function OnInit()
       post.Text ("(Filename: ", fileName, ")\n")
       post.Text ("(Post processor: ", postName, ")\n")
       post.Text ("(Date: ", date, ")\n")
       post.Eol()
    
    
       post.Text ("o<measure> sub\n")
       post.Text ("  o<act> if [ACTIVE[]]\n")
       post.Text ("    G65 P120 R1\n")
       post.Text ("  o<act> endif\n")
       post.Text ("o<measure> endsub\n")
    
    
       
       
       if(scale == metric) then
          post.Text ("G21 (Units: Metric)\n") --metric mode
       else
          post.Text ("G20 (Units: Inches)\n") --inch mode
       end
       post.Text ("G90 (Distance Mode: Absolute)\n")
       post.Text ("G91.1 (Distance Mode IJK: Incremental)\n")
       post.Text ("G94 (Feed Rate Mode: Units per Minute)\n") 
       post.Eol()
       
       post.ModalText ("G00")
       post.ModalNumber (" Z", (safeZ + toolOffset) * scale, "0.0000")
       post.Eol()
       
       bigArcs = 1 --stitch arc segments together
       minArcSize = 0.05 --arcs smaller than this are converted to moves
    end
    
    
    function OnFinish()
       post.Text ("M02\n")
    end
    
    
    function OnRapid()
       post.ModalText ("G00")
       post.ModalNumber (" X", endX * scale, "0.0000")
       post.ModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.Eol()
    end
    
    
    function OnMove()
       post.ModalText ("G01")
       post.ModalNumber (" X", endX * scale, "0.0000")
       post.ModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.ModalNumber (" F", feedRate * scale, "0.0###")
       post.Eol()
    end
    
    
    function OnArc()
       if(arcAngle < 0) then
          post.ModalText ("G03")
       else
          post.ModalText ("G02")
       end
       post.NonModalNumber (" X", endX * scale, "0.0000")
       post.NonModalNumber (" Y", endY * scale, "0.0000")
       --post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
       post.Text (" I")
       post.Number ((arcCentreX - currentX) * scale, "0.0000")
       post.Text (" J")
       post.Number ((arcCentreY - currentY) * scale, "0.0000")
       post.ModalNumber (" F", feedRate * scale, "0.0###")
       post.Eol()
    end
    
    
    
    
    function OnPenDown()
       post.Text ("o<measure> call\n")
          
       post.CancelModalText()
       post.CancelModalNumbers()
        
       post.ModalText ("G00")
       post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
       post.Eol()
       
       post.Text ("M03\n")
       if (pierceDelay > 0.001) then
          post.Text ("G04 P")
          post.Number (pierceDelay,"0.0###")
          post.Eol()
       end
       
       post.ModalText ("G01")
       post.ModalNumber (" Z", cutHeight * scale, "0.0000")
       post.ModalNumber (" F", plungeRate * scale, "0.0###")
       post.Eol()
       
       post.Text ("M54 P1\n")
    end
    
    
    function OnPenUp()
       post.Text ("M54 P0\n")
       
       post.Text ("M05\n")
       if (endDelay > 0) then
          post.Text ("G04 P")
          post.Number (endDelay,"0.0###")
          post.Eol()
       end
       
       post.ModalText ("G00")
       post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
    end
    
    
    function OnNewPart()
       post.Text ("(Part: ",partName,")\n");
    end
    
    
    function OnNewOperation()
       post.Text ("(Operation: ", operationName, ")\n")
    end
    
    
    function OnComment()
      post.Text ("(",commentText,")\n")
    end

Page 1 of 2 12

Similar Threads

  1. machine torch won't fire and can't set Torch height controller
    By bjdawg in forum CNC Plasma / Oxy Fuel Cutting Machines
    Replies: 1
    Last Post: 10-26-2020, 04:55 AM
  2. Replies: 0
    Last Post: 08-02-2017, 04:21 AM
  3. Torch Height Control Issues-Bouncing
    By metriccar in forum PlasmaCam
    Replies: 3
    Last Post: 07-14-2015, 12:58 AM
  4. Torch height Issues - PLEASE HELP!!!
    By Nacs Fab in forum Plasma, EDM / Other similar machine Project Log
    Replies: 3
    Last Post: 02-01-2013, 05:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •