Input an external couple of x-y in GCode

More
18 Jun 2014 20:07 - 18 Jun 2014 20:08 #48066 by andypugh

I Define custom M100 code. -> M100 launch mypythonprogram.py
(mypitonprogram.py bringh a couple of coordinates from vision system and rewrite a custom gcode mysubroutines.ngc files)


I am not clear quite what you are trying to do. But something like this in the actual python routine might work:
import linuxcnc 

....

c = linuxcnc.command

...

c.mdi('G0 X%(xval)f Y%(yval)f' %{"xval":x, "yval":y})

Here are the docs for the Python interface. I think this is what you have been missing :-)

linuxcnc.org/docs/html/common/python-interface.html
Last edit: 18 Jun 2014 20:08 by andypugh.
The following user(s) said Thank You: gfxx

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

  • gfxx
  • gfxx's Avatar Topic Author
  • Visitor
  • Visitor
19 Jun 2014 03:03 #48085 by gfxx
Replied by gfxx on topic Input an external couple of x-y in GCode
@ArcEye ...... when i use qthread (without controll flags or signal) axis-remote command non execute are "parking" in buffer I suppose ...... so I lose command sequence controll ..... there is correct?

@andypugh yes I lose python module interfaces wiki......

@all there is no way to have the same but in c/c++??

sorry a lot for my bad way of writing but my english si not so good.

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

More
19 Jun 2014 06:42 #48097 by andypugh

@all there is no way to have the same but in c/c++??.


You can do more in C / C++ than in Python, as LinuxCNC is largely written in C and C++. The C++ parts tend to look a lot more like FORTRAN++ though, I don't think that the guys who wrote NML really understood OO.

I think you would need to issue NML commands into the queue. The python interface I linked to the docs of is written in C++, you could just copy that.

git.linuxcnc.org/gitweb?p=linuxcnc.git;a...9004a65b9e9ee5b8f1ae

(No, I don't understand that code, and can't help)

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

  • gfxx
  • gfxx's Avatar Topic Author
  • Visitor
  • Visitor
19 Jun 2014 13:06 #48110 by gfxx
Replied by gfxx on topic Input an external couple of x-y in GCode
many thanks for the link andypugh....

I understand that python plugin have complete wiki c++ api not have doc ..... in some parte of this forum I read the NML will be complitely rewrite .... si a correct information?

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

More
19 Jun 2014 18:20 #48118 by andypugh

in some parte of this forum I read the NML will be complitely rewrite .... si a correct information?


The chaps working on Machinekit are looking to replace NML (and are quite well advanced down that track). However I don't see a mechanism for that change to get into LinuxCNC.

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

Time to create page: 0.114 seconds
Powered by Kunena Forum