How to connect buttons and files.

More
10 Apr 2011 11:55 - 10 Apr 2011 11:57 #8738 by Mike_Eitel
OK Ihave partialy sucess:

In the ini file :

OPEN_FILE = /home/cnc/emc2/nc_files/EMC.ngc
......................
#
Connect buttons of screen
HALUI =halui

[HALUI]
MDI_COMMAND = G0 X1 Y1 Z1
MDI_COMMAND = G0 X2 Y2 Z2
MDI_COMMAND = G0 X3 Y3 Z3
MDI_COMMAND = o<Tools/square> call



In the postgui / pyvyp.hal :
net cmd00 pyvcp.cmd00 halui.mdi-command-00
net cmd01 pyvcp.cmd01 halui.mdi-command-01
net cmd02 pyvcp.cmd02 halui.mdi-command-02
net cmd03 pyvcp.cmd03 halui.mdi-command-03


In my ncfiles I have a subdirectoty called tools and as examle herin the file square.ngc:
o<tools/square> sub
G0 Z1
G0 x0 y0
F 120
G1 x0 y0 z0
G1 x0 y10 z0
G1 x10 y10 z0
G1 x10 y0 z0
G1 x0 y0 z0
o<tools/square> endsub
M2
%

As soon as I press the button, all commands in the file are processed correctly.

That way I can predefine some G-code programms, runned without request.
I'll experiment with M1 and message to get additional information and safety on screen

Maybe I'l find also something for .py and jpg. ;-()

Mike
Last edit: 10 Apr 2011 11:57 by Mike_Eitel.

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

More
10 Apr 2011 11:57 #8739 by Rick G
Perhaps Andy will jump in,

In the mean time have you looked at ...

www.linuxcnc.org/component/option,com_ku...d,6514/lang,english/

Rick G

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

More
10 Apr 2011 12:01 #8741 by Rick G
Great, looks like your on your way.

Rick

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

More
10 Apr 2011 12:03 #8742 by Mike_Eitel
Yes Rick

I thibk this will be a good way to go.

I forgot about M101 etc.

Mike

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

More
11 Apr 2011 13:19 #8758 by andypugh
Mike_Eitel wrote:

I forgot about M101 etc.


If you want to call a Python file from a PYVCP button, I think that MDI_COMMAND M100 is probably the way to do it.

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

More
11 Apr 2011 13:37 #8760 by Mike_Eitel
Hi Andy

Yes Ricks way via M1ff commands works

I'm just in the phase to try the available python files and decide wich ones I want to use.

The only bad thing:
I have to copy the files to the base nc_files direktory and rename them to M101 to M1ff ... and make them executable.

I was not able to do it a bit more indircet ( by placing the calls inside those "command files" , means working with the original file names.py . )

Mike

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

More
15 Apr 2011 09:31 - 15 Apr 2011 09:39 #8923 by Mike_Eitel
Hi

I'm totaly frustrated.

I got everthing to work. Nice pyvcp. To metric adjusted phyton files. Calling the phyton files via M1xx command.

BUT no more transfer of data to the Axis screen..... !!!!!!!!!

I could identify some code that is reacting if the phyton program is called inside of Axis....
BUT I dont understand what I have to modify or if it is eventually impossible to get what I wanted ??

I have a downloadable (windows made) zip file on my www at www.eitel.ch/mechatronics/MeCNC/cnc.zip

a.) my complete configuration MeBigCNC2 ( having a second parport at D4000 )
b.\ a part of my nc_files with the M1xx commands and the "source" in the /tools subdirectory

I hope that I did not lost all those hours to "include" .py in axis via buttons ....

Mike

P.S.
I have choosen as username : cnc
Last edit: 15 Apr 2011 09:39 by Mike_Eitel. Reason: File to big

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

More
15 Apr 2011 11:49 #8927 by andypugh
That looks quite elaborate.

I don't have access to an EMC2 machine just now (lunch break). What is it that isn't working? I suspect that the buttons are meant to call python files which create G-Code, and you are not seeing the G-code appear in the window?

Or have I misunderstood?

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

More
15 Apr 2011 11:56 #8928 by Mike_Eitel
Yes Andy

Problem is that the phyton progarm is strting as soon as I press abutton.
Everithing is fine.... BUT the transfer to Axis button is missing, you just see a QUIT button.

I looked into the code and found an "If statement"

I replaced the line for quit by the same command as it would treat normaly...
But no reaction . Nothing is transfered into Axis.

I hope somebody can tell me how to get the python into Axis, when it's called via the M1xx statements.

MIKE

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

More
15 Apr 2011 12:00 #8929 by BigJohnT
Have you looked at the simple g code generators on the wiki site? They send g-code to Axis.

John

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

Time to create page: 0.412 seconds
Powered by Kunena Forum