Any trick to send gcode simultaneously to all printers connected to server ?

Hi all ! 

all is in the title , i am wondering if there's any simple way to run a gcode over all the printers connected to the server. 
gcodes like preheat, or led on or off all sort of simple stuff like that. 
That could be very handy when you run more than 10 same printers on a server.

Thanks ! 

Comments

  • Actually since 1.4.2 this can be written with our programming language. Trick is using

    @sendToPrinter slug command

    Sends command to the printer with given slug name. That way you can execute command sin the context of another printer. Note that command and all command parameter get parsed first in your printer context, so outer quotes get removed and computed expressions get executed. Escape them if that is not wanted accordingly.


    So lets say you have printers with slug names a, b and c and a ist master server, you can write a function
    @func all cmd
    @sendToPrinter a {{local.cmd}}
    @sendToPrinter b {{local.cmd}}
    @sendToPrinter c {{local.cmd}}
    @endfunc

    Put this in event dependent activate script, deactivate and activate so it gets run. On restart of server it start automatically if printer is activated.

    Now you can run
    @call all G28

    to home all 3 printers.
    You can also make a own dialog with most often used parallel commands to be lazy.

  • Repetier said:
    Actually since 1.4.2 this can be written with our programming language. Trick is using

    @sendToPrinter slug command

    Sends command to the printer with given slug name. That way you can execute command sin the context of another printer. Note that command and all command parameter get parsed first in your printer context, so outer quotes get removed and computed expressions get executed. Escape them if that is not wanted accordingly.


    So lets say you have printers with slug names a, b and c and a ist master server, you can write a function
    @func all cmd
    @sendToPrinter a {{local.cmd}}
    @sendToPrinter b {{local.cmd}}
    @sendToPrinter c {{local.cmd}}
    @endfunc

    Put this in event dependent activate script, deactivate and activate so it gets run. On restart of server it start automatically if printer is activated.

    Now you can run
    @call all G28

    to home all 3 printers.
    You can also make a own dialog with most often used parallel commands to be lazy.

    Thanks,

    I simply cant find where to put susc a function. where do i write and save this function?
  • Put it in "run on printer activation" event dependent g-code, then it is available when printer is active even if it is not connected.
  • Repetier said:
    Put it in "run on printer activation" event dependent g-code, then it is available when printer is active even if it is not connected.
    You sure about that? - i need this to work on all printers, i remembered that i could add this in one place and would be able to run it on any printer.

    No where to save functions server sided?
  • Every printer is indepent just because in general they are different and maybe even not all enabled. End custom gcode is very printer and user style dependent.
Sign In or Register to comment.