First Time Help
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
the code I used in the M code is
halcmd setp pcl720.0.pin-24-out 1 (for vac on)
Please Log in or Create an account to join the conversation.
I had set up two M1xx codes to turn on and off the vacuum clamping. I would also like to set up a pyvcp button (or buttons) to turn it on and off. Will setting up the hal commands for the vac on/off button interfere with the M codes I set up?
Yes, the PyVCP button will set the pin state every servo-thread cycle, so if you turn it on with the M-code and the PyVCP button is off, then the vacuum will be on for at most one millisecond.
There are functions in HAL to handle this sort of situation. The hard part is deciding what behaviour you want. Should the M-code always have priority, or should the soft buttons be able to over-ride it? How many PyVCP buttons do you want to use (you could just make the button toggle the state, and the M-code set the state explicitly).
For fun, and to help you see what is possible, have a look at the following HAL functions:
www.linuxcnc.org/docview/html/man/man9/and2.9.html
www.linuxcnc.org/docview/html/man/man9/or2.9.html
www.linuxcnc.org/docview/html/man/man9/maj3.9.html
www.linuxcnc.org/docview/html/man/man9/oneshot.9.html
www.linuxcnc.org/docview/html/man/man9/mux2.9.html
www.linuxcnc.org/docview/html/man/man9/toggle2nist.9.html
www.linuxcnc.org/docview/html/man/man9/flipflop.9.html
Work out what behaviour you want, and I will show you how to set that up in HAL.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
I wonder if I realy set up these M commands right. They each are useing the same setp command one with a 1 and the other with a 0. Should there maybe be more to them? It seems like maybe there should be something more that causes one to cansel out the other so that both can not be active at the same time.
Please Log in or Create an account to join the conversation.
I had M111 set up to turn on the vacuum, and M112 to turn it off. I just set up a couple halui mdi commands and called them from the buttons, It seems to work fine.
I wonder if I realy set up these M commands right. They each are useing the same setp command one with a 1 and the other with a 0. Should there maybe be more to them? It seems like maybe there should be something more that causes one to cansel out the other so that both can not be active at the same time.
No, that is perfectly OK for the M1nn commands. They each write a different value to the pin, as and when required. If you don't do anything, the value stays the same.
However, a PyVCP button writes its value to the connected HAL pin every servo-thread, so will tend-to over-ride the M1nn commands.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
What should the hal look like for connecting my amp falt signal to a pyvcp led look like?
This is what is in the hal now
net Xfault-in pcl720.0.pin-26-in => not.0.in
net Xfault not.0.out => axis.0.amp-fault-in
Can I jsut add the pyvcp.Xfault to the Xfault-in line, or do I need to make a new line in the postgui hal file? (If it needs to be a new line in the postgui how should it look?)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Not really, and another thread on this forum might push it back (weird issues with limits)Any idea what the probable release date of 2.5 will be?
net Xfault-in pcl720.0.pin-26-in => not.0.in
net Xfault not.0.out => axis.0.amp-fault-in
net Xfault pcl720.pin-26-in-not => axis.0.amp-fault-in
The latter, any signal name that you define in the hal file can be re-used in the postgui file, but the PyVCP items don't exist while the main HAL file is loading.Can I jsut add the pyvcp.Xfault to the Xfault-in line, or do I need to make a new line in the postgui hal file?
In you have the option if treating the pcl720.0.pin-26-in pin as a completely separate object, so can use that in the postgui file (you can't directly re-use the in-not pin because that is already linked, but can access the value through the signal name.)
Please Log in or Create an account to join the conversation.