How to use params in @execute ?

Sorry,
i'm searching and searching, but i found no solution for using params in the @execute command.

In the manual is descrpted "@execute cmd param1 param2" but no following information.
My quesrions are:
- how must i declare the params in the extCommands.xml
- which kind of params can i use ? Only constants, or params like layerno, temperatures ans so on ?

e.g

gcode
@excecute info [temp]                            ; send actual temperature from hotbed
or another @excecute info2 Layer1           ; send text "Layer1" 

extCommands:
<execute name="info" allowParams="true">/home/pi/info.sh  ??????</execute>
<execute name="info1" allowParams="true">/home/pi/info.sh  ??????</execute>

info.sh
echo "Temp:" $1 

info1.sh
echo "Layer:" $1 

i hope someone has a solution
thx & cu

Comments

  • Just set allowParams="true" as you already do. The params will then be added after a space to the command you have written already. Just remove the ???????. And also consider that commands are executed as user repetierserver and not pi, so that user must have permissions to start script.

    Dynamic variables are not supported. They are copied exactly as written.

    echo as test is a bad test since you do not see that (or not? not usre?). Maybe pipe into a file for testing.

  • Thx,
    now i understand it and it works. It is a pity that dynamic variables are not possible. Is this perhaps already being considered in development so that it will be available with a future update?
    thx and cu
  • Yes, I'm thinking about it. But it also has the penalty of slowing down command sending abit resp. adding more load. Guess it is neglectible since most commands need only a test that no vars are included. But it will not come with next release, there we have some other big changes.
  • Well, I can understand that. Then I immediately come up with another question: Does that mean that the Gcode will not be executed until the command after the @execute has been completed? So a "sleep 5" in the script would delay the execution of the GCodes by 5 seconds.
    thx and cu
  • No, execute commands are run as independent threads. So delay will only the time to call the script, but it will not wait for it to finish.
  • Ok thank you, that ist good to know.
Sign In or Register to comment.