Disable cycle start / run button until conditions are met?

More
3 years 4 months ago - 3 years 4 months ago #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


RodW
[url=https://mrrodw.au[/url]
Youtube
Last edit: 3 years 4 months ago by rodw.
The following user(s) said Thank You: tommylight

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

More
3 years 4 months ago #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
3 years 4 months ago #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
3 years 4 months ago #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
3 years 4 months ago #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
3 years 4 months ago #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: newbynobi, HansU
Time to create page: 0.142 seconds
Powered by Kunena Forum