virtual button tied to program file

More
28 Feb 2013 21:07 #30679 by beltramidave
Thanks John, I never even thought of making my own GUI. I have seen some of your tutorials and I might look into that further. I don't understand all the programming very good that goes into making things happen.

I actually have not created any files yet, but yes, they should just be a very simple G0 X_Y_. The machine will need to be homed first.

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

More
28 Feb 2013 21:44 #30680 by BigJohnT
As an example this is how I created a rapid to home position for my plasma machine. So for each position create a button, the MDI command, and the link in the hal file. If you don't have halui loaded then you can add it via the ini file .

To get the Rapid to Home button you need to add a line in your ini file in the [HALUI] section:

MDI_COMMAND = G0 X0 Y0 Z0


and in your pyvcp xml file add this

<labelframe text="MDI Commands">
<button>
<halpin>"rapid-to-home"</halpin>
<text>"Rapid to Home"</text>
<font>('Helvetica',10)</font>
</button>
</labelframe>

and in your postgui.hal file add this

# MDI commands
# rapid to home button
net remote-rapid-home halui.mdi-command-00 <= pyvcp.rapid-to-home

John
The following user(s) said Thank You: beltramidave

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

More
28 Feb 2013 21:58 #30681 by beltramidave
Thanks again John! You have no idea how much this helps.

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

More
01 Mar 2013 00:20 #30690 by beltramidave
John,

Are the Axis and Touchy config files available somewhere, so that instead of re-creating everything, one could maybe do some copy and pasting to create their own GUI?

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

More
01 Mar 2013 05:35 - 01 Mar 2013 05:36 #30698 by BigJohnT
All the files are in the Git repository y.

Axis is so complicated and confusing good luck with even trying to find where everything is... the simplest thing is to add a pyvcp panel to Axis and add your buttons there. I have some GUI tutorials that cover some things...

John
Last edit: 01 Mar 2013 05:36 by BigJohnT.

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

More
23 Mar 2013 00:47 #31736 by Todd Zuercher
If you wanted a file to move to the machine origin and call it from a pyvcp button you would set up your button just like John said then, if you call the file "origin" the file would be

oorigin sub
g90
g0g53z0
g0g53x0y0
oorigin endsub

Then you would make your halui command in your ini file be

MDI_COMMAND = oorigin call


The sub file does not have to have the ngc file extension. (mine don't) But I don't think it matters if they do. These subroutine files need to be saved to the directory pointed to by PROGRAM_PREFIX in your ini file.
The following user(s) said Thank You: beltramidave

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

More
23 Mar 2013 00:56 #31737 by beltramidave
Thanks for your help, Todd. That worked perfectly...other than I believe that I will be limited to only 64 MDI calls as I believe that is the max. If there is another method, I would be interested in that. 64 may be enough...but then it may not be either.

Thanks again

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

More
23 Mar 2013 23:04 - 23 Mar 2013 23:20 #31767 by ArcEye

....I believe that I will be limited to only 64 MDI calls as I believe that is the max. If there is another method, I would be interested in that. 64 may be enough...but then it may not be either.


You are limited to 64 halui MDI commands, because that is hard coded in the .ini parsing routine

However you can pass parameters to subroutine calls, so you can have infinite(ish) next level subroutines, which one is executed being determined by the value passed as a parameter.

eg

syntax o <origin> call N where N is the value to pass as param
(local param #1 is the first parameter passed to the subroutine)
o <origin> sub
    if[#1 EQ 0]
        ; do stuff
    else if[#1 EQ 1]
        ; do other stuff etc. etc.
    endif
o <origin> endsub

You would have to do things differently to your current setup, but the principle works from code or halui mdi commands, it's just a question of how you pass the value

regards
Last edit: 23 Mar 2013 23:20 by ArcEye.

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

Time to create page: 0.125 seconds
Powered by Kunena Forum