Disable cycle start / run button until conditions are met?

More
07 Jun 2023 03:41 #273056 by spumco
May this is where classic ladder would be useful?
  • Disconnect cycle start button from whatever hal pin you're using to start a program
  • Add a ladder rung with a bunch of NO contacts in series
  • Connect cycle start button signal to one of the NO contacts, and connect the rest of your sensors to the other contacts.
  • Rung output connected to program run hal pin (halui.program.run?)
  • Another rung the same way, except connect to program step (so the operators can't step/single-block through a program)
Ladder won't let the output go true unless all the conditions are met, and it's easier to see the connections for future modification.  Perhaps if you need to add a sensor (or bypass one).

Bonus - add a keyed switch and connect it to ladder that lets you bypass the interlock chain.

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

More
07 Jun 2023 05:33 #273060 by newbynobi
Cycle Start Button in gmoccapy is not connected in any Hal file, as the button do execute a "command run" code internal. So the button can not be disconnected without touching the gmoccapy code. 

If you want to really disable the start button for certain circumstances you will need to add a few lines of code in gmoccapy file.
IMHO the AND solution proposed is the best way to solve the descriped situation. I personally would add some user messages and with messages inform the user what sensor is not in correct position.

Norbert

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

More
07 Jun 2023 07:43 - 07 Jun 2023 07:44 #273069 by rodw
I think Tommy was on the right track. You might be trying to do something totally unnecessary.
You have to be in teleop mode to jog and you have to be in auto mode to run a program.
halui.mode.teleop will enable jogging. You can see this in Gmocappy as setting that pin will swap tabs to show the jog buttons. A program will not run from that tab. Perhaps you set it up so the door switch is not recognized in the estop chain unless you are in auto mode. eg and2 the door switch with halui.mode.is-auto
Last edit: 07 Jun 2023 07:44 by rodw.
The following user(s) said Thank You: tommylight

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

More
08 Jun 2023 08:01 #273144 by pseudo
Hey guys, thanks for the advice.

I'm pushing a deadline so I had to go for a sub-optimal solution: estop if a program is started when sensors aren't in the ideal state. I did it in classicladder, which is handy and super awkward to use at the same time, still have no idea how to change the name of one of the sections nor how to name the variables.

The logic is basically:
If sensors != true && halui.program.is-running==true: estop latch input.

To make it slightly more user friendly I'll put a little glade panel of the sensor statuses down the side of the screen so they can check before hitting start, it's just a prototype so I'll work on hacking gmooccapy/make a custom UI at some point.

Thanks again.
 

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

More
10 Jun 2023 19:28 #273285 by andypugh
Rather than poking the e-stop, you could poke "halui.program.stop"
In fact it is possible that you might not need the logic related to detecting auto mode. What happens if halui.program.stop is permanently set true? (possibly it is edge-triggered, in which case you would need a bit more logic)

linuxcnc.org/docs/stable/html/man/man1/halui.1.html

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

More
11 Jun 2023 12:17 #273328 by HansU

What happens if halui.program.stop is permanently set true? (possibly it is edge-triggered, in which case you would need a bit more logic)


I am pretty sure it is edge-triggered, so holding it low wouldn't have much effect.

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

More
11 Jun 2023 13:07 #273329 by andypugh
I have had a fiddle, and I think that the best way to do this is with halui.program.is-running and halui.program.stop

halui.mode.is-auto stays true after the program stop, so only provides an edge once.

I would suggest using a "message" component connected to the same signal as halui.program.stop to inform the operator what the problem is.

linuxcnc.org/docs/stable/html/man/man9/message.9.html

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

More
11 Jun 2023 21:32 #273354 by cmorley
The cycle start process is a bit of a weak spot for linuxcnc. There should be a standard way to limit/redefine cycle start from a gui -maybe a HAL pin instead I don't know.
Anyway you do it now can be potentially overridden by another program.

I would suggest modifying Gmoccapy or other screen to redefine cycle start process.
In the long run, I would avoid using halui with a gui for such things - there tends to be subtle race conditions. Add the code to the gui.

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

Moderators: newbynobiHansU
Time to create page: 0.093 seconds
Powered by Kunena Forum