Go to home with one button on PyVCP

More
25 Oct 2013 14:18 #40280 by ktrofimov
Go to home with one button on PyVCP was created by ktrofimov
I am trying to make life of my workers a little bit easier by a cutom PyVCP.
One of tasks - make button "Go home". It seems to be easy by MDI_COMMAND = G0 X0 Y0 Z0
It works, but by all three axes at the same time - it will not work because I need to move Z to safe zone and only then - X0Y0
Two commands on the same line MDI_COMMAND = G0 Z0 G0 X0 Y0 does not work because two similar command could not be in the same sequence
Two commands one by one do not work also because second command stops first without waiting first to finish
Command G28 did not worked - tool did not move at all or moved only by single axe.

Is it possible to wait end of the first command and only then issue another one?

I found one article at forscience.nl/?p=197 where similar functionality achieved by external ladder logic program - too much for such a newbie as I am.
Is there a simplier way?

Please Log in or Create an account to join the conversation.

More
25 Oct 2013 14:38 #40281 by ArcEye
Replied by ArcEye on topic Go to home with one button on PyVCP
Hi

One simple way is to call a sub from the MDI code line

o<homenlift> call

sub would be something like

o <homenlift> sub

G53 G0 X0 Y0
G54 G0 Z20

o <homenlift> endsub


See wiki.linuxcnc.org/cgi-bin/wiki.pl?Oword if not familiar with subs

sub file must be the sub name with .ngc extension eg homenlift.ngc

must be in directory pointed to in ini file under PROGRAM_PREFIX=

regards
The following user(s) said Thank You: ktrofimov

Please Log in or Create an account to join the conversation.

More
25 Oct 2013 15:02 #40282 by ktrofimov
Replied by ktrofimov on topic Go to home with one button on PyVCP
Thanks, will try it!

Please Log in or Create an account to join the conversation.

More
25 Oct 2013 15:33 #40283 by ktrofimov
Replied by ktrofimov on topic Go to home with one button on PyVCP
Yes, it works!!!
Clean and easy.
Thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum