Gcode Replacement

Hi! I am trying to use the gcode replacement tool from RepetierServerPro
I have a lot of gcode generated in my RS, (about 8gb)
I have changed some of my machines from stock heatbreakers to bimetal heatbreakers, this requires a change in printing temperature and I was trying to automate it
I found that my gcode looks something like this
M104 S195
M105
M109 S195

Then try going to: PrinterSettings/G-Codes/Remplacements:
In "Regular Expression" try putting ^M104 S195$
and in Gcode to Execute "M104 S205"

Same for M109 S195

But nothing happens, I don't understand where I'm failing

Comments

  • Did  you send test command manually for testing or use our temperture setting widget. I ask because we also add a T0 for extruder 1 to the gcode. The expression looks good to me if it matches 100% the code. If you always need to add 10˚ you might try something like this

    Expression: ^(M10[49]\s+.*S)(\d+.?\d*)(.*)$
    Replacement
    @if {{@2 > 50}}
    @1{{@2 + 10}} @3
    0

    this cover M104 and M109 also with extra parameter and adds 10˚ for more then 50 so off still works correctly.
  • edited February 2023
    It doesn't work for me, copy the commands I see in the console.

    Send:15:32:06.367: N150593 M75 CFFFP_3DBenchy
    Send:15:32:06.367: N150594 M73 P0 R157 Q0 S157
    Send:15:32:06.406: N150595 M140 S55
    Send:15:32:06.416: Slow command added:M190 S55
    Send:15:32:06.416: N150597 M190 S55
    Send:15:32:06.421: N150598 M104 S195
    Send:15:32:06.436: Slow command added:M109 S195
    Send:15:32:06.436: N150600 M109 S195
    Send:15:32:29.322: M117 ETA 18:02:48 day 9
    Send:15:32:29.322: N150601 M73 P4 R151 Q4 S151
    Send:15:32:29.322: N150602 M82 ;absolute extrusion mode
    Send:15:32:29.329: Slow command added:G28
    Send:15:32:29.329: N150603 G28

    after that just cancel the print

    I also attached the image of how I copied your code

    https://photos.app.goo.gl/fhAU32hHryuhopMc7

    Thanks
  • I also have some gcode with a temperature of 200°C
    This code would increase them 10°C, so would it leave them at 210°C? Is that so or am I misinterpreting it?
  • Line 4 is missing a at sign before 0. Forum likes to eat some chars so that is missing for anything below 50.

    Since condition is anything above 50 gets 10 added yes 200 becomes 210. Worked for me. If you do want a uppe rlimit add a extra condition to the rule. @2 contains the temperate to set.
  • Repetier said:
    Line 4 is missing a at sign before 0. Forum likes to eat some chars so that is missing for anything below 50.

    Since condition is anything above 50 gets 10 added yes 200 becomes 210. Worked for me. If you do want a uppe rlimit add a extra condition to the rule. @2 contains the temperate to set.
    add the at sign before the 0 in the fourth line but the temperature still doesn't change, I don't know what I'm doing wrong...  :(
  • For me it was working in my tests.
    You can add a extra line like
    M118 Changed

    to see if it tried to replace at all. With sich changes it is alwazs the question if expression is not recogniced or if the replacement is not working for some reason.
  • Repetier said:
    For me it was working in my tests.
    You can add a extra line like
    M118 Changed

    to see if it tried to replace at all. With sich changes it is alwazs the question if expression is not recogniced or if the replacement is not working for some reason.
    add the command

    I don't know if I should add an at sign in front or not, so add with and without at sign

    and I don't see any message in the console (I think that this command would show me the message "change" in the console, right?)

    I copy the capture again, to know if you see something where I could be wrong

    https://photos.app.goo.gl/QuP9zJuJoUhPbMQc9

    this shows me the console

    Send:11:56:40.220: N537 M75 CFFFP_3DBenchy
    Send:11:56:40.220: N538 M73 P0 R157 Q0 S157
    Send:11:56:40.220: N539 M140 S55
    Recv:11:56:40.228: ok (3)
    Send:11:56:40.233: Slow command added:M190 S55
    Send:11:56:40.233: N541 M190 S55
    Recv:11:56:42.242: echo:busy: processing
    Recv:11:56:42.242: ok
    Send:11:56:42.242: N542 M73 P3 R152 Q3 S152
    Send:11:56:42.242: N543 M104 S195
    Recv:11:56:42.248: ok (2)
    Send:11:56:42.253: Slow command added:M109 S195
    Send:11:56:42.253: N545 M109 S195





  • I think I know why it did not work. Did you send the gcode as print job or manually. Just discovered that the replacements were not applied to print jobs. Fixed that for next release.

    However if you just want it for print jobs you can go to Printer Settings and add a offset to your extruder, which does this addition inside print jobs.

  • Try sending the job from Projects, From the printer with the "DirectPrint" button and from the Gcode that I have saved in the printer in "Groups"
    In neither case did the script work.

    With the Offset I was able to solve the problem, but I would have liked to use the script to put an upper limit on the temperature (because I have some segmented gcode with the temperature already modified)

    Is there a way to download all the gcode from the server and upload them again? I think I could make a script with python or java and modify them on my PC, and upload them again, is this possible? I didn't find a way to download all the gcode together, if I can do it one by one, but it's quite a long job that I don't want to do.
  • We have just released 1.4.9 where I have the replacement bug fixed, so you can use our first solution. Just don't mix them.

    Reuploading does not fix the issue, this is a runtime replacement.
Sign In or Register to comment.