Python interface, relative/machine coords [SOLVED]

More
9 years 6 months ago #92372 by TurBoss
Hello

How I can know in python if I'm on machine or relative coordinate system?

Thanks

Please Log in to join the conversation.

More
9 years 6 months ago #92386 by cmorley
search through the active gcodes for the relative codes (G90/G91)
Unfortunately this can't be relied on in a running program because of the interpreter reading ahead of the actual machine.
There is a test branch to work on this problem hopefully merged in the future.

Oh wait now I think you mean you are referring to the DRO display.
You can't without being plugged into/modifying the program that creates this.
DRO display type is not a system wide setting it's a per screen setting.
linuxcnc has very few ways to communicate between screens.

Are you building a screen or building a gladeVCP panel? What screen are you using?
With more context I may be able to give more ideas.

Chris M

Chris M

Please Log in to join the conversation.

More
9 years 6 months ago #92390 by TurBoss
I'm building a 7 segment display to show the coordinates

a physical one

Please Log in to join the conversation.

More
9 years 5 months ago #92403 by cmorley
Again without more info I'm guessing.

What screen are you going to use?
Some are easier to hack into then others.
It may require to customize the internal code of the screen, which is a pain if you update.
but all possible.

Chris M

Please Log in to join the conversation.

More
9 years 5 months ago #92404 by TurBoss
The screen is a series of 7 degment displays using max7219

the controller board is a teensy ++ 2.0

Currently I'm using Axis Gui
and using linuxcnc 2.8pre from github repos updated daily

Please Log in to join the conversation.

More
9 years 5 months ago #92407 by cmorley
using axis's ./axisrc file you could tap into the setting of coordinates.

for instance adding:
Code:
def test(self): print 'hi' root_window.bind("#", test)

Will print test when you toggle # (coordinate display)
unfortunately it doesn't if you select using the menu and mouse.

Modifying AXIS is mostly undocumented and requires detective-ness and patients.

Chris M

Please Log in to join the conversation.

More
9 years 5 months ago #92412 by TurBoss
Ok

so there is no way to get it from a python component?

Thank you so much

Please Log in to join the conversation.

More
9 years 5 months ago #92441 by cmorley
Well AXIS is a python program but i guess you mean a separate program - No

Please Log in to join the conversation.

More
9 years 5 months ago #92773 by bevins
g5x_index
(returns string) - currently active coordinate system, G54=0, G55=1 etc.

Please Log in to join the conversation.

More
9 years 5 months ago #92779 by TurBoss
Thanks cmorley & bevins

I ended doing this:
pytrhon:
gist.github.com/TurBoss/9df83b5709add77760d0a1e8380f27b7

Teensy:
gist.github.com/TurBoss/71659a3829c2c3fef0c21758fe92a803

as I only use G54 for now i'm done

Thanks again

Please Log in to join the conversation.

Time to create page: 0.104 seconds
Powered by Kunena Forum