- Posts: 82
- Thank you received: 0
Touch off having a hard time with HAL side
2 years 4 months ago #303254
by sajurcaju
Touch off having a hard time with HAL side was created by sajurcaju
I have figured out making a touchoff button on my Pyvcp panel. What I'm not sure about (despite hours of reading examples and looking at the 2.8 documentation) is how to make it actually do anything, which I think is a HAL question (let me know if I'm in the wrong place).
I'm using LinuxCNC/AXIS version 2.8.4-76 etc.
In Stepconf, there is a page for custom HAL commands, where I have entered (as the first and only MDI command):
MDI_COMMAND = o<z_touch>call
1. How does HAL know where to find the subroutine, i.e. the path to the gcode z_touch?
Here is the xml corresponding to the touch off button:
<button>
<font>("Helvetica",14)</font>
<width>3</width>
<halpin>"z-zero"</halpin>
<text>"Z"</text>
</button>
I need to connect the 'z-zero' button to my touch off subroutine. I think I need a line like this:
net do-z-touchoff halui.mdi-command-00 <= pyvcp.z-zero
2. Does this go in custom_postgui.hal ?
3. Is that all I need?
I also want to use a spinbox to input the touch plate thickness, but I'll leave that question for the next round.
Thank you,
Steve
I'm using LinuxCNC/AXIS version 2.8.4-76 etc.
In Stepconf, there is a page for custom HAL commands, where I have entered (as the first and only MDI command):
MDI_COMMAND = o<z_touch>call
1. How does HAL know where to find the subroutine, i.e. the path to the gcode z_touch?
Here is the xml corresponding to the touch off button:
<button>
<font>("Helvetica",14)</font>
<width>3</width>
<halpin>"z-zero"</halpin>
<text>"Z"</text>
</button>
I need to connect the 'z-zero' button to my touch off subroutine. I think I need a line like this:
net do-z-touchoff halui.mdi-command-00 <= pyvcp.z-zero
2. Does this go in custom_postgui.hal ?
3. Is that all I need?
I also want to use a spinbox to input the touch plate thickness, but I'll leave that question for the next round.
Thank you,
Steve
Please Log in to join the conversation.
2 years 4 months ago #303260
by Aciera
linuxcnc.org/docs/html/config/ini-config.html
That should be all.
Replied by Aciera on topic Trajectory Planner using Ruckig Lib
in the [RS274NGC] section of your ini file add the location of your subroutines to the entry 'SUBROUTINE_PATH ='1. How does HAL know where to find the subroutine, i.e. the path to the gcode z_touch?
linuxcnc.org/docs/html/config/ini-config.html
Since the hal pins related to the button are created with the gui you need to add the corresponding HAL lines to the 'POSTGUI_HALFILE'2. Does this go in custom_postgui.hal ?
That should be all.
Please Log in to join the conversation.
2 years 4 months ago #303285
by sajurcaju
Replied by sajurcaju on topic Touch off having a hard time with HAL side
I get an error from Axis:
Unknown word where unary operation could be. Position: Relative Actual
Searching took me to a page that said this certainly came from gcode interpretation. I have reduced my sub to just start and end statements:
o<z_touch> sub
o<z_touch> endsub
and still get the same error.
Nowhere in the various config files is the subroutine file name used, only the directory. Is this correct?
Thanks
Unknown word where unary operation could be. Position: Relative Actual
Searching took me to a page that said this certainly came from gcode interpretation. I have reduced my sub to just start and end statements:
o<z_touch> sub
o<z_touch> endsub
and still get the same error.
Nowhere in the various config files is the subroutine file name used, only the directory. Is this correct?
Thanks
Please Log in to join the conversation.
2 years 4 months ago #303286
by Aciera
If you change this:
MDI_COMMAND = o<z_touch>call
to
MDI_COMMAND = (debug,MDI button pressed)
And you press the button, do you get a message like this:
Replied by Aciera on topic Touch off having a hard time with HAL side
That is correct, the interpreter will search for the subroutine in the paths declared.Nowhere in the various config files is the subroutine file name used, only the directory. Is this correct?
If you change this:
MDI_COMMAND = o<z_touch>call
to
MDI_COMMAND = (debug,MDI button pressed)
And you press the button, do you get a message like this:
Attachment not found
Please Log in to join the conversation.
2 years 4 months ago #303287
by Aciera
Replied by Aciera on topic Touch off having a hard time with HAL side
The error 'Unknown word where unary operation could be.' points to a syntax error in Gcode.
If the interpreter was unable to find the subroutine then you would get error like
'seeking o-word: o<z_touch> from line .. '.
So there is something else going on.
If the interpreter was unable to find the subroutine then you would get error like
'seeking o-word: o<z_touch> from line .. '.
So there is something else going on.
Please Log in to join the conversation.
2 years 4 months ago #303288
by sajurcaju
Replied by sajurcaju on topic Touch off having a hard time with HAL side
I made your change, saved and restarted Axis. Same error message.
Please Log in to join the conversation.
2 years 4 months ago #303289
by sajurcaju
Replied by sajurcaju on topic Touch off having a hard time with HAL side
Here are my various mods:
.ini file
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
SUBROUTINE_PATH = ncsubroutines:/home/steve/linuxcnc/subroutines
HAL
HALUI = halui
[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = MDI_COMMAND = (debug,MDI button pressed)
postgui_call_list.hal
# touch off Z
net ztouchoff halui.mdi-command-00 <= pyvcp.z-zero
custompanel.xml
<button>
<font>("Helvetica",14)</font>
<width>3</width>
<halpin>"z-zero"</halpin>
<text>"Z"</text>
</button>
There are other mods, the jog button pyvcp example. They work fine until I try my added touchoff Z button, when I get the error and the jog buttons no longer work. So I think it's the Z button section in error, rather than some other part.
.ini file
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
SUBROUTINE_PATH = ncsubroutines:/home/steve/linuxcnc/subroutines
HAL
HALUI = halui
[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = MDI_COMMAND = (debug,MDI button pressed)
postgui_call_list.hal
# touch off Z
net ztouchoff halui.mdi-command-00 <= pyvcp.z-zero
custompanel.xml
<button>
<font>("Helvetica",14)</font>
<width>3</width>
<halpin>"z-zero"</halpin>
<text>"Z"</text>
</button>
There are other mods, the jog button pyvcp example. They work fine until I try my added touchoff Z button, when I get the error and the jog buttons no longer work. So I think it's the Z button section in error, rather than some other part.
Please Log in to join the conversation.
2 years 4 months ago #303291
by Aciera
MDI_COMMAND = (debug,MDI button pressed)
Replied by Aciera on topic Touch off having a hard time with HAL side
Well this would explain the error you got. This line should be:MDI_COMMAND = MDI_COMMAND = (debug,MDI button pressed)
MDI_COMMAND = (debug,MDI button pressed)
Please Log in to join the conversation.
Time to create page: 0.095 seconds
