Remap with yield INTERP_EXEC_FINISH + MDI mode

More
01 Mar 2023 14:27 - 01 Mar 2023 14:30 #265655 by arabel1a
Hello everyone!

I'm trying to remap M6 subroutine. Due to custom hardware usage and a lot of bash M-functions, i have to store current tool number and it's technology parameters in a file. So, my remap scheme is:

1. In prologue, read a file containing current tool, set parameters for ngc (current tool position, do it need return old tool, new tool position and etc.)
2. In ngc machine do some movements and write a new tool to a file.

Unfortunately, this does not work in auto mode. Namely, although i see that file changes, python prologue reads the prevous values. Note that in MDI everything is OK. To solve this, i've added
yield INTERP_EXEC_FINISH

before reading the file and replaced all return statements with yield. This way everything works fine in auto mode, but not in MDI. If i call M6 in mdi, it prints all prints from prologue, and then frezzes, no movements nor MSG from ngc file are done.
Last edit: 01 Mar 2023 14:30 by arabel1a.

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

More
02 Mar 2023 05:48 #265696 by cmorley
I'd suggest showing you remap code, to get an chance of an opinion.

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

More
04 Mar 2023 11:41 #265837 by andypugh
I have a feeling that it might be better to work with the existing tool handling system, even if that is more difficult.
Note that iocontrol is a pluggable module, so you could use your own modified version.
linuxcnc.org/docs/stable/html/config/ini....html#_emcio_section [EMCIO]EMCIO = io / iov2 chooses between:
github.com/LinuxCNC/linuxcnc/blob/master.../iotask/ioControl.cc
and
github.com/LinuxCNC/linuxcnc/blob/master...task/ioControl_v2.cc
You can combine a modified emcio with a remap, if that is necessary.

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

Time to create page: 0.159 seconds
Powered by Kunena Forum