issues with iocontol and M6 remap in python

More
14 Mar 2019 14:59 - 14 Mar 2019 16:38 #128587 by bevins
In a pure python remap in master, when the command emccannon.TOOL_CHANGE gets sent in the epilog to task, task is suppose to send and EMC_TOOL_LOAD message to iocontrol and wait for iocontrol to assert tool-change pin. iocontrol never asserts the tool-change pin.

Since the tool-change pin and tool-changed pin never gets asserted, I can never apply the offsets because the tool number never gets set. the tool change happens, and I send G43 but it does not get set on the selected tool.

I am having a hard time trying to track down why iocontrol is not asserting the change-tool pin.

Any ideas?

relevant hal lines:
Warning: Spoiler!


epilog snippet
Warning: Spoiler!
Last edit: 14 Mar 2019 16:38 by bevins. Reason: Adding the code snippets.

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

More
14 Mar 2019 15:09 #128588 by bevins
I never get the print message after the CHANGE_TOOL command gets sent.

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

More
15 Mar 2019 04:13 - 15 Mar 2019 04:43 #128637 by bevins
Anyone having issues with this?

Remap pure python is broken again. The interpreter is ignoring emccannon commands.

I have nothing in the remap, no Q-busters nothing, and it wont run the epilog.

ini entry:
Warning: Spoiler!


M6 Remap:
Warning: Spoiler!


This is showing that meets the if criteria for epilog
Attachments:
Last edit: 15 Mar 2019 04:43 by bevins.

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

More
15 Mar 2019 12:33 - 15 Mar 2019 12:37 #128650 by bevins
I think I may try ngc. oword remap.
remap Mcodes for existing python functions, subs and see if this doesnt work better.
Attachments:
Last edit: 15 Mar 2019 12:37 by bevins.

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

More
15 Mar 2019 13:31 #128653 by pl7i92
Yoiu better send the Full comands as you are interfearing
so G43 Hx
as yoiu know the toolnumber x = toolnumber to be set

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

More
15 Mar 2019 16:26 - 15 Mar 2019 16:26 #128667 by bevins

Yoiu better send the Full comands as you are interfearing
so G43 Hx
as yoiu know the toolnumber x = toolnumber to be set


it needs the toolnumber to be able to set G43. Its not getting the tool number out of the remap. iocontrol is not getting the nml message to set to change.
Last edit: 15 Mar 2019 16:26 by bevins.

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

More
16 Mar 2019 11:55 #128725 by andypugh
Have you tried iocontrolV2?

Documentation seems sparse-to-missing

linuxcnc.org/docs/2.7/html/config/ini-co....html#_emcio_section

But here is a sample INI file with some comments:
github.com/LinuxCNC/linuxcnc/blob/0f91c5...ntrolv2-demo.ini#L65

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

More
16 Mar 2019 12:53 #128729 by bevins

Have you tried iocontrolV2?

Documentation seems sparse-to-missing

linuxcnc.org/docs/2.7/html/config/ini-co....html#_emcio_section

But here is a sample INI file with some comments:
github.com/LinuxCNC/linuxcnc/blob/0f91c5...ntrolv2-demo.ini#L65


I looked at it and thought about it but I dont understand the way it works. The docs didnt help much in the way the internals work so I didnt try it.

I am pretty sure it is the interpreter ignoring commands issue. I am trying to get in touch with Michael H at machinekit but no luck yet.

My code is at github.com/bobbevins/Linuxcnc_python_remap_M6 . There is alot of work went into the implementation of this machine. Its getting frustrating, lol, I had thoughts of trying it in oword, but I'm not brave enough yet......

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

More
16 Mar 2019 13:06 - 16 Mar 2019 13:41 #128730 by bevins
I also tried a bare bones remap with no queuebuster and it still doesn't send the emccanon.CHANGE_TOOL nor the
self.set_tool_parameters() or self.toolchange_flag = True.

EDIT: I am basing the fact that the interpreter is ignoring the command because when I send emccannon.CHANGE_TOOL, task is suppose to send an NML message to iocontrol and iocontrol.o.tool.change get set to true. thats not happening also when I send tool-change_flag = true, that should tell iocontrol and iocontrol.0.tool.changed happens, which is suppose to send message back and then the offsets get set depending on the selected pocket. emccannon.CHANGE_TOOL gets sent with "selected_pocket" parameter.
None of this is happening, I dont know wether I should loop the iocontrol or not in this case. /EDIT

So I think something is broken.

If I yield throughout the toolchange, then the interpreter starts ignoring commands and things get haywire.

So I am deadlocked.
Last edit: 16 Mar 2019 13:41 by bevins.

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

More
16 Mar 2019 13:59 #128737 by andypugh
You need to trigger this code here:
github.com/LinuxCNC/linuxcnc/blob/master...sk/ioControl.cc#L825

And it looks like CHANGE_TOOL should do that:
github.com/LinuxCNC/linuxcnc/blob/master...sk/emccanon.cc#L1984

As it does create a EMC_TOOL_LOAD_TYPE

There is a rtapi_print_msg(RTAPI_MSG_DBG in the iocontrol code, it would be useful to know if the code is being called. Unforunately the messageing level here is _not_ set from the INI file. You might even need a HAL component to call linuxcnc.org/docs/2.7/html/man/man3/rtap...sg_level.3rtapi.html

(It used to be possible to set a value in /proc/ but I don't think that works any more.)

However, looking at your code I see
from emccanon import MESSAGE, SET_MOTION_OUTPUT_BIT, CLEAR_MOTION_OUTPUT_BIT,SET_AUX_OUTPUT_BIT,CLEAR_AUX_OUTPUT_BIT

Maybe change that to
import emccanon
so that you have access to all the canonical commands.
The following user(s) said Thank You: bevins

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

Time to create page: 0.104 seconds
Powered by Kunena Forum