Linuxcnc python module questions

More
22 Nov 2016 15:29 #83125 by gaeldk
Hello,

I am using Linuxcnc for controlling a machine that does some measurement. Everything is setup and configured and all works well with Axis when running manual commands or G-code.

But now I want to automate fully and in python some of the movements that need to be done.

something a bit similar than what this guy is doing here :


But then I am wondering about a few things :
- Ideally I do not want to have Axis running, just a python program, is it possible ?
- In the video above, Kent does all his stuff AFTER the machine is homed, can I launch a homing sequence from the python module alone?

If there is a simple example that shows some basic controlling of steppers via the python module that would be great. I found quite some stuff but it always is linked to building a GUI, which I don't need in this case.

Thanks for the help !

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

More
22 Nov 2016 16:23 #83126 by Todd Zuercher
While I haven't done it myself I do believe it is possible. (I don't know enough about Python and programming to pull it off, yet. Something similar is on my to do list.)
Have you read this part of the manual?
linuxcnc.org/docs/2.6/html/common/python-interface.html

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

More
22 Nov 2016 16:25 #83127 by gaeldk
Thanks yes and I started to test. Everything works like a charm when AXIS is up and running, will now try without it...

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

More
22 Nov 2016 16:35 #83128 by gaeldk
And without AXIS I can not launch the home sequence, the enabled state is false and I don't know what command should be issued to enable the system without axis.

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

More
22 Nov 2016 16:40 #83129 by Todd Zuercher

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

More
22 Nov 2016 16:49 #83131 by Todd Zuercher

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

More
22 Nov 2016 16:52 #83132 by Todd Zuercher
This is really well beyond my skill level, so I'm going to stop pointing to the manuals now. (Still watching with interest though. So please share what you figure out.)

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

More
22 Nov 2016 16:53 #83133 by gaeldk
Yes thanks have seen those but not sure how to enable the system without axis and launching a specific machine conf...

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

More
23 Nov 2016 11:35 #83158 by gaeldk
So just to sum up I am now stuck with starting in pure python mode, so load the right conf, then enable the machine.

How can I do this without axis ?

Thanks

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

More
23 Nov 2016 14:11 #83166 by ArcEye
There is no 'python mode'.
The python bindings are just python friendly access to existing C and C++ calls.

And without AXIS I can not launch the home sequence, the enabled state is false and I don't know what command should be issued to enable the system without axis.


Axis contains all the calls you need, you just need to remove the GUI clutter.
By studying what Axis does, it will become apparent what calls are made in python to change machine state etc.

Some of the same calls are also available from halui, but you should make them directly preferably.

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

Time to create page: 0.250 seconds
Powered by Kunena Forum