ATC Project - Debug phase

More
4 years 3 months ago - 4 years 3 months ago #246621 by spumco
Replied by spumco on topic ATC Project - (Remap Phase)

Thanks.  Where exatly should I put the 'print' statement?  I tried in a few places in stdglue.py and LCNC hung up while starting:
 
That's not as useful as it could be, but does tell us both that the file is being run, and that it is the version of the file that you think it is.
 

I hadn't even thought of that, thank you.

I've been looking at other configs which are presumably working, I see that in the INI files there's usually another PATH_APPEND = x line under [PYTHON].

Some examples:
[PYTHON]
TOPLEVEL=python/toplevel.py
PATH_APPEND=python


or
[PYTHON]
PATH_PREPEND = python
TOPLEVEL = python/toplevel.py


or
[PYTHON]
TOPLEVEL=./toplevel.py
PATH_APPEND= ./
PATH_APPEND= ../../nc_files/remap_lib/python-stdglue/


or
[PYTHON]
PATH_PREPEND=./python
PATH_APPEND=../../nc_files/remap_lib/python-stdglue/
TOPLEVEL=python/toplevel.py


whereas mine looks like this:
[PYTHON]
# ***leave the following commented out unless you are using the ATC macros***
TOPLEVEL = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/toplevel.py
PATH_APPEND = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/


I don't have a PATH_PREPEND, nor do i seem to have a simple PATH_APPEND=python.

LCNC manual for remap has this:

# code specific for this configuration
PATH_PREPEND=./

# generic support code - make sure this actually points to python-stdglue
PATH_APPEND=../../nc_files/remap_lib/python-stdglue/



Am I missing something?
Last edit: 4 years 3 months ago by spumco. Reason: miserable editor

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

More
4 years 3 months ago #246643 by andypugh
Replied by andypugh on topic ATC Project - (Remap Phase)
You are using a private copy of stdglue, so shouldn't need to add that path.

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

More
4 years 3 months ago #246644 by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
So path is OK, but stdglue is still not passing global parameters through.

When I do the magic comment for a global parameter, I get an expected result. i.e. #<_tool_in_spindle> = 1

When I do the magic comment for the corresponding local named parameter, I get #<tool_in_spindle> = ######

Do the pound signs indicate anything useful for troubleshooting?

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

More
4 years 3 months ago #246646 by andypugh
Replied by andypugh on topic ATC Project - (Remap Phase)
##### means that the parameter does not exist.
I am unsure whether you would _expect_ a local parameter to be visible outside the creating context.

What happens if you copy the value of the remap-local parameter to a global parameter in the remap routine?

eg, in the remap routine have "#100 = #<tool_in_spindle>" then check #100 in MDI.

Or, add the line

(DEBUG, #<tool_in_spindle>)

At the start of your remap routine.

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

More
4 years 3 months ago #246654 by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
Code:
eg, in the remap routine have "#100 = #<tool_in_spindle>" then check #100 in MDI.

Did you mean to change the routine to be #100 = #<_tool_in_spindle> (global)?

 I'll try it when I get home later, but I think I've tried that and got some error.

I just noticed another difference between my stdglue.py and the one in LCNC's sim on github.  The 'standard' one has the following in the change epilog:

Mine (which I'm convinced was lifted from the Gmoccapy tool touch-off example):
Code:
if self.return_value > 0.0:             if self.return_value == 3:                 message = "No tool measurement ! Please take care of the entry in the tool table"                 emccanon.MESSAGE(message)             return INTERP_OK         else:             if self.return_value == -1:                 message = "Searchvel <= 0, not permitted!, Please correct INI Settings."             elif self.return_value == -2:                 message = "Probevel <= 0, not permitted!, Please correct INI Settings."             elif self.return_value == -3:                 message = "Probe contact failiure !!"             else:                 message = "M6 aborted (return code %.1f)" % (self.return_value)             self.set_errormsg(message)             return INTERP_ERROR

The standard version:
Code:
if self.blocks[self.remap_level].builtin_used:             #print "---------- M6 builtin recursion, nothing to do"             yield INTERP_OK         else:             if self.return_value > 0.0:                 # commit change                 self.selected_pocket =  int(self.params["selected_pocket"])                 emccanon.CHANGE_TOOL(self.selected_pocket)                 self.current_pocket = self.selected_pocket                 self.selected_pocket = -1                 self.selected_tool = -1                 # cause a sync()                 self.set_tool_parameters()                 self.toolchange_flag = True                 yield INTERP_EXECUTE_FINISH             else:                 self.set_errormsg("M6 aborted (return code %.1f)" % (self.return_value))                 yield INTERP_ERROR

Raise any red flags?

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

More
4 years 3 months ago #246656 by andypugh
Replied by andypugh on topic ATC Project - (Remap Phase)

Code:
eg, in the remap routine have "#100 = #<tool_in_spindle>" then check #100 in MDI.


Did you mean to change the routine to be #100 = #<_tool_in_spindle> (global)?

No, I was suggesting to make a global copy of the local variable to look at in the global context.
The following user(s) said Thank You: spumco

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

Time to create page: 0.135 seconds
Powered by Kunena Forum