You are not logged in.

#1 2019-09-20 14:16:55

NJN
Member
Registered: 2019-08-20
Posts: 16

Laser Code unable to use "nested" functions

If I use a nested function such as the included example of [[ExecReturn python /home/pi/printer/calculate_speed.py [[LayerNumber]] [[TotalSolidArea]]]] in the "Laser Code", it appears to always get interpreted as sending "[[LayerNumber" to the python script, then sending [[TotalSolidArea]] (which does nothing because there's no letter to use as G code) then sends the final "]]" as an additional command!

I see this result as an error message from my Python code saying that it doesn't recognise the argument "[[LayerNumber", while the RAMPS terminal returns the error message unknown command: "]]"

This problem does not happen with any of the other Code boxes (e.g. Code after each layer), it's only the Laser Code!

Basically, the first instance of "]]" is ending the opening [[ExecReturn, not matching with the most recent "[["

I've tried enclosing the whole thing in curly brackets as "an equation" and checking I definitely have the right number of square brackets, but the result is always the same...

Offline

#2 2019-09-21 14:59:44

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: Laser Code unable to use "nested" functions

Hmm it should not happen. Could you post a debug file?

Offline

#3 2019-09-23 09:42:51

NJN
Member
Registered: 2019-08-20
Posts: 16

Re: Laser Code unable to use "nested" functions

I'll see what I can do but this week will be extremely busy, so it might be a while before I have a chance to try it again and generate a new debug file, sorry!

It was pretty repeatable, even when I changed my Python script to be a single comma-separated argument instead of separate individual arguments the result was exactly the same so it should be easy for you to replicate even using the ExecReturn example?

Offline

Board footer

Powered by FluxBB