You are not logged in.

#1 2019-09-13 16:07:24

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

G Code from Python using ExecReturn

If I use [[ExecReturn]] in my G Code within NanoDLP, what level of response am I able to control/retrieve externally?

The examples I have seen so far have been along the lines of F[[ExecReturn python speed.py [[LayerNumber]] ]] to get a speed etc. but what if I want to have an external function call to determine whether I move or not in the first place?

In this scenario, if the external check passes, I return "Z10". If the check fails, I return nothing (no movement). In other words, I don't want to return zero (Z0) because that would mean homing Z, or require relative movement which risks losing track of where I am for the *next* movement that *does* pass my external check, and if I set Z[[ExecReturn and return nothing, then it might fail if there is Z and no number at all?

I don't know if I am explaining what I want to do well enough...

Maybe if I use an abstracted example (I know this won't make any sense for a real printer, but just go with it!):

Say I have a Python function that looks to see if the layer image is completely blank, and therefore I can skip it completely without waiting for the layer to cure or do any lifting or whatever. Can I return the next x/y/z position G code from the Python stdout as [[ExecReturn os.stdout.write("X<x> Y<x> Z<x>")]] or would it have to be X[[ExecReturn os.stdout.write("<x>")]] Y[[ExecReturn os.stdout.write("<y>")]] Z[[ExecReturn os.stdout.write("<z>")]] if it makes sense what I mean by that?

I'm still waiting for my printer stage to arrive before I can test things, so at the moment I'm trying to get as much of the programming side of things ready to go in advance, otherwise I could just check to see if it works!

Thanks in advance

Offline

#2 2019-09-14 16:26:25

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

Re: G Code from Python using ExecReturn

You can return whole gcode line. For example python script return empty or G1 F100 and etc.

Offline

#3 2019-09-14 17:43:52

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

Re: G Code from Python using ExecReturn

Excellent, that's good to know, thanks!

I'm liking this software more and more :-)

Offline

Board footer

Powered by FluxBB