REMAP function doesn't work

More
6 years 9 months ago - 6 years 9 months ago #156041 by aleksamc
I try to continue my study of remap.
Now I stuck at python runnig program (first example)
1) In .ini file I write
REMAP=G88.6 modalgroup=1 argspec=XYZp python=g886
2) Then I created file g886.py in the same directory as ngc remapping files.
3) In file I write my program from standart example
4) I've got an error:
Code:
'g886' is not a Python callable function - 48:REMAP=G88.6 modalgroup=1 argspec=XYZp python=g886
I get such error if I complitly delete file from the folder also.
What problem could be?

I've read "4. Upgrading an existing configuration for remapping"


but still have problem
Last edit: 6 years 9 months ago by aleksamc.

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

More
6 years 9 months ago #156064 by satiowadahc
Can you post your python code?

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

More
6 years 9 months ago - 6 years 9 months ago #156080 by aleksamc
I added all necessary files. Now I'm very bad in python but I hope to study it using examples in technical docs.

File Attachment:

File Name: Axis4_2020-01-29.ini
File Size:2.74 KB

File Attachment:

File Name: g886.py
File Size:315 B

File Attachment:

File Name: remap.py
File Size:22 B

File Attachment:

File Name: stdglue.py
File Size:14.56 KB

File Attachment:

File Name: toplevel.py
File Size:13 B


What editor Can I use to write program for python? Using it in gedit is very inconvenient.
Last edit: 6 years 9 months ago by aleksamc.

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

More
6 years 9 months ago #156140 by satiowadahc
I may be mistaken but I believe your return needs to be indented on line 10.

Editor personal preference for general python is atom for generic writing, and pycharm for extreme debugging, but it doesn't work as nice when using linuxcnc

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

More
6 years 9 months ago #156154 by aleksamc
I changed to
<return 0>

Nothing changed: " 'g886' is not a Python callable function.
May be it should be somehow compiled?

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

More
6 years 8 months ago #156920 by andypugh
Probably too late now (I have a huge forum backlog)

You probably need to make the Python files executable.

And they might also need the
Code:
#! usr/env python
magic incantation at the top.

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

Time to create page: 0.497 seconds
Powered by Kunena Forum