Axis switch from mdi to manual mode and back

More
12 Sep 2012 23:26 #24219 by Rick G
You can use "axisui.set-manual-mode" to set the Axis GUI to manual mode.

You can also use "halui.mode.manual" to set manual mode, "halui.mode.mdi" can be used to set mdi mode.

But it does not appear to me that there is a "axisui.set-mdi-mode" to set the Axis GUI to mdi mode.

Rick G

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

More
12 Sep 2012 23:40 #24220 by BigJohnT
You want to set the boot up mode to MDI?

John

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

More
13 Sep 2012 06:31 #24225 by ArcEye
Hi Rick

Axis appears to use a combination of

ensure_mode(emc.MODE_MDI) to set the mode
and
mdi_up_cmd(*args) to display the MDI tab and set it up

Not sure if this helps whatever you are trying to do

regards

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

More
13 Sep 2012 11:24 #24234 by Rick G
Hello guys,

I use a joypad to do most of the set up a new job. The jog features only work in manual mode. So on a large machine if you accidentally walk away from the keyboard with the joypad to where you are setting up in mdi mode the jogging will not work. For this I use a button on the joypad to set the AXIS gui and halui in manual mode the pins are "axisui.set-manual-mode" and or "halui.mode.manual". I also have programed other buttons on the joypad to MDI commands and to start subs. For these I need halui to be in MDI mode. I use "halui.mode.mdi" for this, however this can leave the AXIS screen in manual mode while halui is in MDI mode. It would be nice to have a hal pin to change AXIS to MDI mode the way the pin "axisui.set-manual-mode" sets it to manual mode.

Rick G

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

More
13 Sep 2012 11:44 #24236 by BigJohnT
You would have to add that pin to axis.py.

After line 3066 insert

comp.newpin("set-mdi-mode".hal.HAL_BIT,hal.HAL_IN)

Then around line 776 I think you could copy the set manual mode and change the names to set mdi mode and that should work until the next update.

John

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

More
14 Sep 2012 11:22 #24266 by Rick G
Thanks, good info I will take a look.

Rick G

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

More
14 Sep 2012 15:11 #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
15 Sep 2012 03:01 #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
17 Sep 2012 16:05 #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
26 Nov 2013 22:15 #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:
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
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.

Time to create page: 0.134 seconds
Powered by Kunena Forum