Axis switch from mdi to manual mode and back

More
14 years 1 month ago #24268 by aike
Rick G wrote:

Thanks, good info I will take a look.

Rick G

Let me know if it will be as BigJohn told. I have the same problem as you.
I use external operator panel (siemens lathe) and switch manual->mdi and mdi->manula is possible only with mouse.

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

More
14 years 1 month ago #24281 by aike
I added next strings to /usr/bin/axis
###string 671
### self.set_mdi_mode = False
###string 3066
### comp.newpin("set-mdi-mode",hal.HAL_BIT,hal.HAL_IN)
###string 782
### set_mdi_mode = comp["set-mdi-mode"]
### if self.set_mdi_mode != set_mdi_mode:
### self.set_mdi_mode = set_mdi_mode
### if self.set_mdi_mode:
### root_window.tk.eval(pane_top + ".tabs raise mdi")
###
and some strings in panel.hal
## switch from MDI window in MANUAL/AUTO window
net user-manual-mode <= pyvcp.set-manual-mode-btn
net user-manual-mode => axisui.set-manual-mode
## switch from MAN/AUTO window in MDI window
net user-mdi-mode <= pyvcp.set-mdi-mode-btn
net user-mdi-mode => axisui.set-mdi-mode

And it works!

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

More
14 years 1 month ago #24337 by Rick G
Thanks everyone for the info.

Before I could run a g code file from the joy pad using an MDI command such as...

In my ini file
[HALUI]
MDI_COMMAND = o<home> call

and the sub home.ngc

o<home> sub
g53 g0 z0
g53 g0 x0y0
o<home> endsub
M2

and that worked fine.

However

o<home> sub
(debug, CAUTION HIT RESUME TO RAPID MACHINE Z THEN X AND Y TO G53 HOME POSITION)
M0 (pause)
M110
g53 g0 z0
g53 g0 x0y0
o<home> endsub
M2

would cause an error.

aike,

I edited the axis file as shown by your post and magically the hal pin was created, hooked that up to a button on the joy pad and now all is well.

Thanks.

By the way I bounce back and forth between manual and MDI mode when setting up and I do not know how many times I have entered M3 or M5 without looking and thinking I was in MDI mode only to be in manual mode and instead of the desired result I accidentally set a feed override. So as I was editing axis anyway I went down to around line 2584 in axis.

def activate_axis_or_set_feedrate(n):
# XXX: axis_mask does not apply if in joint mode
if manual_ok() and s.axis_mask & (1<<n):
activate_axis(n)
else:
set_feedrate(10*n)


and commented out

# else:
# set_feedrate(10*n)

To disable the feedrate shortcuts on my machine.

Rick G

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

More
12 years 11 months ago #41182 by ruffle
To save anyone else a bit of work, here's a patch file for 2.5.3 Axis to implement set-mdi-mode.

This patch also implements an axisui output pins that reflects the current manual/mdi tab. I did this so that I could use one button on my pendant to flip between Manual and MDI modes using the toggle2nist hal thingie.

Download the patch from here , save a copy of /usr/bin/axis and then do:
Code:
patch /usr/bin/axis </path-to-the-downloaded-patch/axis.2.5.3.mdi.mode.patch

To make use of the above from an xhc pendant, add the following to custom_postgui.hal
Code:
net tog_mode xhc-hb04.button-mode => toggle.N.in net tog_mode_out toggle.N.out => toggle2nist.N.in net is_mode_mdi axisui.mode.mdi => toggle2nist.N.is-on net flip_to_mdi toggle2nist.N.on => axisui.set-mdi-mode net flip_to_manual toggle2nist.N.off => axisui.set-manual-mode

...changing 'xhc-hb04.button-mode' to the button of your choice and 'N' on each line to the toggle and toggle2nist numbers you want to use.

If you don't have a 'spare' toggle or toggle2nist then check in custom.hal for lines like 'loadrt toggle count=2' and 'addf toggle.2 xxx-thread' and add another toggle and toggle2nist.

HtH.
The following user(s) said Thank You: Rick G, bottleworks

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

More
12 years 11 months ago #41194 by Rick G
Thanks for sharing.

Rick G

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

More
12 years 9 months ago #42855 by kostas
I want to connect some physical buttons for changing axis from manual to mdi, but can't connect to axisui.set-manual-mode pin when starting. The program terminates with the error "Pin 'axisui.set-manual-mode' does not exist"
I guess that axisui is not loaded yet at the time hal goes to connect the pin, so how does one use it?

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

Time to create page: 0.261 seconds
Powered by Kunena Forum