Subroutine GUI

More
04 Apr 2011 17:00 #8502 by piasdom
Replied by piasdom on topic Re:Subroutine GUI
if i got this right;

.xml creates the button
custom_postgui.hal links the button
and .ini defines the button

net remote-Home-All halui.Home-All <= pyvcp.Home-All

net is a command
remote-Home-All is the name of the button.(can be whatever name i want? )
halui.Home-All is the pin(don't know if halui needs to be there)
<= is the linking
pyvcp.Home-All is from xml file

so far i have this;
=================================================================================
# Include your customized HAL commands here
# The commands in this file are run after the AXIS GUI (including PyVCP panel) starts

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

# home all button
net remote-Home-All halui.Home-All <= pyvcp.Home-All
================================================================================
but it errors with halui.Home-All does not exist.

i know net starts it
net _______ halui._______ <= pyvcp._______
do these(net,halui,pyvcp) "HAVE" to be in the linking ?

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

More
04 Apr 2011 17:10 - 04 Apr 2011 17:11 #8504 by BigJohnT
Replied by BigJohnT on topic Re:Subroutine GUI
Almost,

correct
.xml creates the button
custom_postgui.hal links the button

and .ini defines the button = not exactly, the ini defines the MDI command only so it has to be something that you can type in the MDI window to work as a halui.mdi-command-nn

net is a command = correct
remote-Home-All is the name of the button.(can be whatever name i want? ) = correct almost it is the signal name not the button name

halui.Home-All is the pin(don't know if halui needs to be there) yes, halui must be there and I don't think you can change the spelling to caps but not sure so best to just have halui.home-all

<= is the linking = incorrect the <= does nothing it is there to help/confuse humans only

pyvcp.Home-All is from xml file = correct that is the name of the button pin

The error is probably the caps in the halui pin name...

Take a moment and read this couple of pages it might make more sense now that you have done a bit of hal.

www.linuxcnc.org/docview/html/hal_basic_hal.html

John
Last edit: 04 Apr 2011 17:11 by BigJohnT.

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

More
04 Apr 2011 17:11 #8505 by piasdom
Replied by piasdom on topic Re:Subroutine GUI
does halui._____ have to be a command from the list of MDI commands?
as in G0 X0 Y0 Z0

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

More
04 Apr 2011 17:14 #8506 by BigJohnT
Replied by BigJohnT on topic Re:Subroutine GUI
halui.mdi-command- has to be one of the MDI commands in the ini file.

But not halui pins.

John

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

More
04 Apr 2011 17:43 #8508 by piasdom
Replied by piasdom on topic Re:Subroutine GUI
in the ini you typed MDI_COMMAND = G0 x0 y0 z0.
so i would write HOME_ALL = g0 X? Y? X? in my ini?
in the linking, it's mdi-command-00. i know it can't be capitalized, but it goes from -(minus sign) to _(underscore)

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

More
04 Apr 2011 17:55 #8510 by BigJohnT
Replied by BigJohnT on topic Re:Subroutine GUI
MDI_COMMAND = G0 X0 Y0 Z0 is a valid MDI command and HOME_ALL is not. Only G Codes can be used for MDI commands. You can't make up G codes like you can signal names.

halui does much more than just execute MDI commands. That is but one thing that halui does. halui has a bunch of pins that do various things.

The list of halui pins is here:

www.linuxcnc.org/docview/html/man/man1/halui.1.html

The pin that may interest you is halui.home-all. It is a pin not a MDI command so try linking it to your button as I told you earlier with the net command:

net remote-home-all halui.home-all <= pyvcp.home-all

net = the command
remote-home-all = the signal
halui.home-all = the halui pin that requests all axis to home
<= = nothing
pyvcp.home-all = the name of the pyvcp button you created.

John

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

More
04 Apr 2011 17:58 #8511 by piasdom
Replied by piasdom on topic Re:Subroutine GUI
and i found this

net <signal-name> <pin-name> <opt-direction> <opt-pin-name>

net both-home-y <= parport.0.pin-11-in

what the
<signal-name> = both-home-y
<pin-name> =
is the <= between here ?
<opt-direction> =
<opt-pin-name> =

from above. they're 4 "names" in the format, but only 3 "names" in the connection.

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

More
04 Apr 2011 18:04 - 04 Apr 2011 18:05 #8512 by BigJohnT
Replied by BigJohnT on topic Re:Subroutine GUI
In the example:

net both-home-y <= parport.0.pin-11-in

<signal-name> = both-home-y
<opt-direction> = <= which does nothing at all and can be left out
<pin-name> = parport.0.pin-11-in
<opt-pin-name> = none in this case

Only two "names" are in the above net command. One is the signal name and one is the pin name. The signal name can be almost anything and the pin name has to be a valid pin name.

opt- means it is optional to use them.

John
Last edit: 04 Apr 2011 18:05 by BigJohnT.

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

More
04 Apr 2011 18:25 #8518 by andypugh
Replied by andypugh on topic Re:Subroutine GUI
piasdom wrote:

in the ini you typed MDI_COMMAND = G0 x0 y0 z0.
so i would write HOME_ALL = g0 X? Y? X? in my ini?


halui has many, many pins. (it is also optional, which is why you need to ensure it loads with the HALUI=halui INI file parameter)
JT has posted a link to the listing.
You can, however, add even more:

For every MDI_COMMAND {Some G-Code} line you add to your INI file, an extra pin is created called halui.mdi-command-NN where NN starts at 00 and increments for every MDI_COMMAND line.

Any time that you set the halui.mdi-command-NN pin to high (from low) the bit of G-code in the MDI_COMMAND line is run (note, this only happens in manual mode, not when running a progam)

You can set the pin high from the command line (and that can be useful) but generally you do it by linking it, in the HAL file, to a pin which is in turn linked to a PYVCP GUI button.

However, MDI_COMMANDs can only be G-code (subroutine calls (O<mysub> CALL ) are valid, incidentally). If you want a non-G-code result, like home-all then there are other halui pins that you can link to the PYVCP button, like halui.home-all.

Yes, it _is_ complicated.

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

More
04 Apr 2011 19:04 #8519 by piasdom
Replied by piasdom on topic Re:Subroutine GUI
THANKS. that helped a lot. (really:)
i think my trouble is naming it in the ini.
i don't understand why you had halui.mdi-command-00 in the customhal
and MDI_COMMAND in the ini. should i write HOME_ALL = ?????
or as it's written in the customhal - home all = ?????
i've tried both. pins still does not exist. i see the home all pin in the link you gave me,
and i think i have everything else right. just can't get this naming in the ini.

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

Time to create page: 0.089 seconds
Powered by Kunena Forum