call O subrutine from python
- diegoroman17
- Offline
- Premium Member
Less
More
- Posts: 140
- Thank you received: 2
26 Nov 2013 06:14 #41168
by diegoroman17
call O subrutine from python was created by diegoroman17
Hi,
I have my own GUI in GladeVCP. I need execute a O subrutine that is in a .ngc file that I previously have opened. How can I do it? Thanks for help me.
I have my own GUI in GladeVCP. I need execute a O subrutine that is in a .ngc file that I previously have opened. How can I do it? Thanks for help me.
Please Log in or Create an account to join the conversation.
26 Nov 2013 06:22 #41169
by BigJohnT
Replied by BigJohnT on topic call O subrutine from python
Use a MDI call to your subroutine.
JT
JT
Please Log in or Create an account to join the conversation.
26 Nov 2013 14:44 #41173
by newbynobi
This info is from here
Norbert
Replied by newbynobi on topic call O subrutine from python
import linuxcnc
s = linuxcnc.stat()
c = linuxcnc.command()
def ok_for_mdi():
s.poll()
return not s.estop and s.enabled and s.homed and (s.interp_state == linuxcnc.INTERP_IDLE)
if ok_for_mdi():
c.mode(linuxcnc.MODE_MDI)
c.wait_complete() # wait until mode switch executed
c.mdi("G0 X10 Y20 Z30")
This info is from here
Norbert
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
Less
More
- Posts: 140
- Thank you received: 2
26 Nov 2013 21:36 #41178
by diegoroman17
Replied by diegoroman17 on topic call O subrutine from python
Precisely I have used the same statements replaced "c.mdi("G0 X10 Y20 Z30") " with "c.mdi("o100 call")" but this don´t work. The error say unable for read the file 100, but I don´t need read the file I need read the o subrutine inside the file that I have opened.
Please Log in or Create an account to join the conversation.
26 Nov 2013 21:58 #41179
by mhaberler
That is a misunderstanding how o-word MDI calls are processed
Just put the subroutine in a file 100.ngc and go from there, and it will work
-Michael
Replied by mhaberler on topic call O subrutine from python
Precisely I have used the same statements replaced "c.mdi("G0 X10 Y20 Z30") " with "c.mdi("o100 call")" but this don´t work. The error say unable for read the file 100, but I don´t need read the file I need read the o subrutine inside the file that I have opened.
That is a misunderstanding how o-word MDI calls are processed
Just put the subroutine in a file 100.ngc and go from there, and it will work
-Michael
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
Less
More
- Posts: 140
- Thank you received: 2
26 Nov 2013 22:09 #41180
by diegoroman17
Replied by diegoroman17 on topic call O subrutine from python
Thanks Michael I try it. I have wanted to use the same file but if is necessary create other file don't problem.
Please Log in or Create an account to join the conversation.
26 Nov 2013 22:20 #41183
by newbynobi
Replied by newbynobi on topic call O subrutine from python
can you please give more information about your GUI?
Norbert
Norbert
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
Less
More
- Posts: 140
- Thank you received: 2
27 Nov 2013 00:12 #41185
by diegoroman17
Replied by diegoroman17 on topic call O subrutine from python
sure.
Really in not only GUI. I have develop a custom CAM for CorelDraw that build the .ngc file for a laser machine. Now I want add the functionality of press a button en my GUI and the machine move along the perimeter without activate the laser. This is to see if the figures draw inside the material without do measurement of material. I have included the o subrutine that will draw the perimeter inside my .ngc and want only call this subrutine when I press the button "Trace". Now I have tried the solution of Michael and this work fine. Only is a few "ugly" have two files and the one only with o subrutine
Really in not only GUI. I have develop a custom CAM for CorelDraw that build the .ngc file for a laser machine. Now I want add the functionality of press a button en my GUI and the machine move along the perimeter without activate the laser. This is to see if the figures draw inside the material without do measurement of material. I have included the o subrutine that will draw the perimeter inside my .ngc and want only call this subrutine when I press the button "Trace". Now I have tried the solution of Michael and this work fine. Only is a few "ugly" have two files and the one only with o subrutine
Please Log in or Create an account to join the conversation.
27 Nov 2013 00:31 #41186
by newbynobi
Replied by newbynobi on topic call O subrutine from python
Hallo,
is you CAM code open source?
I am asking, because I am planing to do something similar, and why invent the wheel twice?
If so, could you send me a copy?
What about screen shots?
Norbert
is you CAM code open source?
I am asking, because I am planing to do something similar, and why invent the wheel twice?
If so, could you send me a copy?
What about screen shots?
Norbert
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
Less
More
- Posts: 140
- Thank you received: 2
27 Nov 2013 01:13 #41187
by diegoroman17
Replied by diegoroman17 on topic call O subrutine from python
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.156 seconds