How to set the execution order of G-codes and o-word or remaps

More
02 Jan 2021 10:58 #193824 by Cornflakes
Hi!

How to set the execution order of G-codes and o-word or remaps proc?

I have remapped M400 on python

Then i run program:
G0 ...
M400
G0 ...
M400
G0 ...
M400
M2

Before LCNC execute all M400 commands
Then LCNC execute G0, G0, G0

But i need execute commands step by step
What i should do?

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

More
More
02 Jan 2021 11:51 #193831 by Cornflakes
I was read docs
But i can't find the answer (

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

More
02 Jan 2021 12:41 #193835 by Cornflakes
I think, that commands must be executed sequentially line by line.
Commands are on different lines.
There are no modals groups

All M400 on Python are executed first
And only after that all G0 run

But i need G0, M400, G0, M400, G0, M400 sequentially

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

More
02 Jan 2021 14:50 #193841 by cmorley
Sorry i get it now.
Is this in remap?
Can you give more info? maybe the relevant files?

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

More
02 Jan 2021 17:42 - 02 Jan 2021 18:05 #193860 by Cornflakes
In my files:

.ini:

[RS274NGC]
REMAP=M440 modalgroup=10 python=m440

remap.py:

def m440(self, **words):
print "Test call M440"
return INTERP_OK

.ngc:

o109 if [#<_task> NE 1.0]
m2
o109 endif

o110 repeat [3]
(MSG,Paused)
m0
M440
o110 endrepeat
m2

I see in terminal window, that message "Test call 440" prints three times first.
And then i press resume 3 times

The same situation is with G0

I think, that after M0 program must stop and wait
Last edit: 02 Jan 2021 18:05 by Cornflakes.

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

More
02 Jan 2021 18:24 #193868 by cmorley
ok M0 is a queue buster - you need to wait until control returns.

In python remaps one uses yield
linuxcnc.org/docs/devel/html/remap/remap...ntions_ngc_to_python

'Dealing with queue-buster: Probe, Tool change and waiting for a HAL pin'

It's not clear to me if this is possible without using python directly
The following user(s) said Thank You: chen1234

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

More
02 Jan 2021 20:53 #193891 by MaHa
I have experienced this behaviour before with user defined M commands. When Mnnn is followed by 'M66 E0 L0', it works as expected.

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

Time to create page: 0.111 seconds
Powered by Kunena Forum