disable run button if door open

More
27 Jun 2024 18:02 #303915 by greg23_78
I wanted to know if this modification is still functional?
Hi

You can achieve this quite simply by a short hack of Axis

After line 2071 in the master (search for [b]def task_run(*event): [/b] )
insertif comp['run-disable']  : return
iedef task_run(*event):
        if comp['run-disable']  : return  ## inserted line
        if run_warn(): return

        global program_start_line, program_start_line_last
        program_start_line_last = program_start_line;
        ensure_mode(linuxcnc.MODE_AUTO)
        c.auto(linuxcnc.AUTO_RUN, program_start_line)
        program_start_line = 0
        t.tag_remove("ignored", "0.0", "end")
        o.set_highlight_line(None)
Then at line 3243 in the master ( search for [b]comp.newpin("notifications-clear-error",hal.HAL_BIT,hal.HAL_IN)[/b])
insert
[b]comp.newpin("run-disable",hal.HAL_BIT, hal.HAL_IN)[/b]

ieif hal_present == 1 :
    comp = hal.component("axisui")
    comp.newpin("jog.x", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.y", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.z", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.a", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.b", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.c", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.u", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.v", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.w", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin("jog.increment", hal.HAL_FLOAT, hal.HAL_OUT)
    comp.newpin("notifications-clear",hal.HAL_BIT,hal.HAL_IN)
    comp.newpin("notifications-clear-info",hal.HAL_BIT,hal.HAL_IN)
    comp.newpin("notifications-clear-error",hal.HAL_BIT,hal.HAL_IN)
    comp.newpin("run-disable",hal.HAL_BIT, hal.HAL_IN)                    ## inserted line
    vars.has_ladder.set(hal.component_exists('classicladder_rt'))

You will now have a pin called [b]axisui.run-disable[/b]

If that is set to TRUE (1) it will not be possible to run a program as the function will return

regards

I made the modifications as explained in the topic but it doesn't work on my side.

hal_file
net door-open-disable-run           hm2_7i97.0.inmux.00.input-11-not
net door-open-disable-run           axisui.run-disable

i try with
net axisui.run-disable           hm2_7i97.0.inmux.00.input-11-not       

because i,m not the best in hal language and i want be sure is not a hal syntax problem
i have no error with it but it doesn't work.

error is
pin 'axisui.run-disable' does not exist

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

More
27 Jun 2024 18:04 #303916 by greg23_78
on my halcompil, i see the pin axisui.run-disable

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

More
27 Jun 2024 22:59 #303938 by Grotius
In hal i think :
net just_a_name axisui.run-disable hm2_7i97.0.inmux.00.input-11-not

Then the python code is indeed stopping at this line when run-disable is active:
if comp : return

The name : axisui.run-disable looks ok to me.

I think you are almost there.

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

More
28 Jun 2024 01:21 #303948 by COFHAL

on my halcompil, i see the pin axisui.run-disable

The axis pins must be loaded after AXIS is fully loaded or else the pin does not exist error occurs.  Include them in another file so it loads later, like postgui.  hal or other.

 

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

More
28 Jun 2024 08:54 #303963 by greg23_78
I made the modification,
net door-open-disable-run             axisui.run-disable                 hm2_7i97.0.inmux.00.input-11-not
in my postgui file

I no longer get errors but it still doesn't work, my pin axisui.run-disable remains on false while my input hm2_7i97.0.inmux.00.input-11-not works fine

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

More
28 Jun 2024 18:27 #303985 by chris@cnc

I wanted to know if this modification is still functional?


 

Why you not using motion.feed.hold pin?
net door-open-disable-run             motion.feed.hold                 hm2_7i97.0.inmux.00.input-11-not

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

More
29 Jun 2024 09:45 #304012 by andypugh

I no longer get errors but it still doesn't work, my pin axisui.run-disable remains on false while my input hm2_7i97.0.inmux.00.input-11-not works fine


I think that probably means that the postgui HAL file isn't being executed. Did you add the postgui file to the [HAL] section of the INI file?

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

Time to create page: 0.203 seconds
Powered by Kunena Forum