You are not logged in.

#1 2018-11-29 15:33:58

Rocky
Member
Registered: 2018-04-09
Posts: 20

Delay not working in Before Each Layer GCode

Hello, I have the following GCode inside before each layer:

G90
G1 Z{([[CurrentPosition]] + [[LayerThickness]])*([[LayerNumber]] > 1)} F[[ZSpeed]]
[[WaitForDoneMessage]]
M114
[[Delay {((( ([[LayerNumber]] >= 2) * ([[LayerNumber]] <= 2)) * 5)+
(( ([[LayerNumber]] >= 3) * ([[LayerNumber]] <= 3)) *4)+
(( ([[LayerNumber]] >= 4) * ([[LayerNumber]] <= 9)) * 3)+
(( ([[LayerNumber]] >= 10) * ([[LayerNumber]] <= 20)) * 2)+
(( ([[LayerNumber]] >= 21) * ([[LayerNumber]] <= 50)) * 1)+
(( ([[LayerNumber]] >= 51) * ([[LayerNumber]] <= 80)) *0)+
(( ([[LayerNumber]] > 80) * 0))}]]

And I'm getting echo:Unknown command: "[[Delay 4.0000]] in terminal.
I tried executing the delay command manually in the terminal and it worked fine. But executing [[Delay {4}]] in the terminal doesn't work

Is it a bug or am I doing something wrong?

Offline

#2 2018-12-01 19:50:51

Shahin
Administrator
Registered: 2016-02-17
Posts: 2,562

Re: Delay not working in Before Each Layer GCode

Could you share screenshot of the mentioned error?

Offline

#3 2018-12-03 10:54:23

Rocky
Member
Registered: 2018-04-09
Posts: 20

Re: Delay not working in Before Each Layer GCode

Hello Shahin,
Here's a screenshot of the error:

error_screenshot.PNG

I have assumed that the error is caused by the zeroes followed by the number, but executing the command manually from the terminal functions properly

Offline

#4 2018-12-03 21:02:19

Shahin
Administrator
Registered: 2016-02-17
Posts: 2,562

Re: Delay not working in Before Each Layer GCode

Do you paste exact gcode or evaluated one on terminal?

Offline

#5 2018-12-04 14:56:26

Rocky
Member
Registered: 2018-04-09
Posts: 20

Re: Delay not working in Before Each Layer GCode

I have done both, one where I have literally written the following

[[Delay 10.0000]]
M114

Where I had to wait for 10 seconds for M114 to be executed.
and the other test I have done was executing

[[Delay {10}]]
M114

Where the delay was neglected.
Excuse my random assumption, but might it be that the number returned from between the braces "{}" is of type long and the numbers I literally type are of type float? Where this might be the issue.

Last edited by Rocky (2018-12-04 14:56:46)

Offline

#6 2018-12-04 15:22:42

Shahin
Administrator
Registered: 2016-02-17
Posts: 2,562

Re: Delay not working in Before Each Layer GCode

I cannot reproduce the issue. Please, make sure you are on the latest beta vesion. And see if the issue still persists.

Offline

#7 2018-12-05 11:02:37

Rocky
Member
Registered: 2018-04-09
Posts: 20

Re: Delay not working in Before Each Layer GCode

You're right! It worked on the new beta version 1928.
The issue was occuring on version 1919
I have also executed

tail -f /var/log/printer.log

and found that the error was: 2018/12/05 09:54:24.127629 {"Layer":"1","module":"Gcode","level":"Error","msg":"Delay Value Problem strconv.ParseFloat: parsing '{0.05}': invalid syntax"}

which no longer exists.
Thanks for the help!

Last edited by Rocky (2018-12-05 11:02:59)

Offline

#8 2019-01-10 15:38:11

Rocky
Member
Registered: 2018-04-09
Posts: 20

Re: Delay not working in Before Each Layer GCode

Hello Shahin,
I just want to clarify that this worked for me on the newer version while executing manually in the terminal and not from the "AfterEachLayer" GCode

Offline

Board footer

Powered by FluxBB