Method and function

More
4 years 8 months ago - 4 years 8 months ago #234078 by smplc
Method and function was created by smplc
Just trying if step.ngc calls remapped g71.8 yet.  g71_8 function error self not defined of method and function self.execute().  Should a class and method from the import interpreter file define self and execute?  Could the interpreter file not be imported?  Python path has interpreter.py and probably all associated import files.  Are any import files missing for the interpreter.py?  Are any other import files expected?  The interpreter would be preference python communicating with ngc including if python iterates loops back and forth with ngc.

An alternative is import linuxcnc and program Neutral Messaging Language (NML) with Python but NML doesn't appear as flexible as the interpreter when communicating to ngc program.  Required would be X and Z axes, some random G, M and F codes.  I seen the Linux Developer Manual and NML messages but not sure which messages to use without enough description.  Some of the NML messages don't have written from and read to files.  Is a more detail description about NML messages and where including commanding X and Z axes, some random G, M and F codes?

step.ngc, a of g71.8 a0.5, parameter error regardless lathe.ini including remap g71.8 modalgroup=1 argspec=a py=g71_8 .  Could the argspec expect angle brackets with parameter but python doesn't accept angle brackets?  Would an ngc file with a remapped G-code and especially parameter accept a python file?
Last edit: 4 years 8 months ago by smplc. Reason: Add'l attachment

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

More
4 years 8 months ago #234096 by andypugh
Replied by andypugh on topic Method and function
Do you have a remap folder containing toplevel.py and remap.py ?

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

More
4 years 8 months ago #234121 by smplc
Replied by smplc on topic Method and function
Yes, it's the last image attached foregoing.  They were extracted from the Ubuntu search and Debian directory and placed at the new folder named python.

I was testing importing a file and a one way is from filename import* .  Then revised g71_8.py with from interpreter import* .  Axis, Lathe and Reloaded step.ngc and again error self of self.execute() not defined .  Is still missing some import files?   
Attachments:

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

More
4 years 8 months ago #234124 by andypugh
Replied by andypugh on topic Method and function
It might not be valid to use "A" as a parameter to a remapped code. (As it names an axis)

Also try
Code:
def g78_1(self, **words)

So that the remap passes the "self" struct into your code.

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

More
4 years 8 months ago #234144 by smplc
Replied by smplc on topic Method and function
Thanks.  self was probably out of scope regardless defined from the interpreter.  self.execute() is operable with one command yet.
Attachments:

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

More
4 years 8 months ago #234153 by smplc
Replied by smplc on topic Method and function
g71.8.ngc wouldn't accept parameter a (lowercase) of g71.8 even though remap included argspec=a py=g71_8. Changed to argspec=d and resolved. ngc probably should use an uppercase parameter if remapped g-code, python and using parameter **words.

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

Time to create page: 0.612 seconds
Powered by Kunena Forum