Machine On button.
- Dougal9887
- Offline
- Junior Member
- Posts: 22
- Thank you received: 3
I've been using LinuxCNC for a couple of years now, but apart from setting up using the stepconf wizard, I have not attempted any other interaction with Linux.
So please assume no prior knowledge!
I would like to be able to switch on my machine, using a relay interface board controlled by a bob pin.
Unlike Estop, Machine On does not appear as a choice in Stepconf.
I thought this might be as simple as adding a couple of lines to the .hal file, similar to those used for the coolant button. However I just get a message reporting that Machine On isn't recognised.
Any help in getting the machine on button to actually do what it is supposed to do would be much appreciated.
Thanks, Dougal.
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
- Posts: 3925
- Thank you received: 1687
net machine-on <= <your-pin-here> => halui.machine.on
Please Log in or Create an account to join the conversation.
- Dougal9887
- Offline
- Junior Member
- Posts: 22
- Thank you received: 3
I will go and try that right now and report back.
Please Log in or Create an account to join the conversation.
- Dougal9887
- Offline
- Junior Member
- Posts: 22
- Thank you received: 3
Any more ideas?
Thanks, Dougal.
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
- Posts: 3925
- Thank you received: 1687
net machine-on => parport.0.pin-16-out => halui.machine.on
to:
net machine-on => parport.0.pin-16-out <= halui.machine.is-on
Please Log in or Create an account to join the conversation.
- Dougal9887
- Offline
- Junior Member
- Posts: 22
- Thank you received: 3
Is this what the second version of code will accomplish?
Thanks,
Dougal.
Please Log in or Create an account to join the conversation.
- Dougal9887
- Offline
- Junior Member
- Posts: 22
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- Dougal9887
- Offline
- Junior Member
- Posts: 22
- Thank you received: 3
I think I can now see that the first response, 'machine.on', appears to be correct.
However, when that didn't work and I attached the snippet of code, the respondent was alerted to the code being that code run before the gui started and changed the response to 'machine.is-on'.
I put the line of code in the configuration .hal file simply because it was the only file I have ever altered.
It now appears to me that, since the action I wanted occurs after the gui is open, the code should have appeared in a postgui hal file.
So my question now please is, to achieve the action stated above, what should the line of code look like to attach the gmoccapy 'machine on' button to parallel port pin 16 and switch on the machine, where should the line of code be written and where would I find that place?
It would also be interesting to understand why 'machine.is-on' works to toggle the button on/off when it is described as an input, presumably to display the current state of the machine.
Thanks, Dougal.
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
- Posts: 3925
- Thank you received: 1687
'halui.machine.on' is an input that is used to put the machine in the 'on' state. I suggested using this because I falsely thought you wanted to use an external switch to do that.I think I can now see that the first response, 'machine.on', appears to be correct.
Since we are not using any gmoccapy related pins there is no need to put this in the postgui_halfile. 'halui' pins exist already before the gui has loaded. The button state in the gui reflects the state of 'machine.is-on'.It now appears to me that, since the action I wanted occurs after the gui is open, the code should have appeared in a postgui hal file.
It would also be interesting to understand why 'machine.is-on' works to toggle the button on/off when it is described as an input, presumably to display the current state of the machine.
'halui.machine.is-on' is an _output_ that reflects the current state of the machine.
linuxcnc.org/docs/html/gui/halui.html#_machine
Please Log in or Create an account to join the conversation.
- Dougal9887
- Offline
- Junior Member
- Posts: 22
- Thank you received: 3
Reading that document, now from a different perspective, makes sense.
Dougal.
Please Log in or Create an account to join the conversation.