- Posts: 399
- Thank you received: 133
Create new HAL component
- persei8
- Topic Author
- Offline
- Platinum Member
-
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
- Posts: 6803
- Thank you received: 2181
Also if using a gscreen or glade style screen in 2.8/master you can get a all-homed signal that you could connect to a HAL pin (just another option)
Chris M
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
linuxcnc.org/docs/devel/html/man/man9/logic.9.html
But where is the fun in that?
The source code for master (V 2.9) hal components are here:
github.com/LinuxCNC/linuxcnc/tree/master/src/hal/components
help yourself to the and2.comp file and modify to your needs. It would be a very good starter exercise
So to compile and install all you need to do is
If you are not using a run in place version (eg compiled from source), you will need to use sudo.
Its so much fun to be able to extend linuxcnc like this and halcompile is well documented on the main documentation page of linuxcnc.
Please Log in or Create an account to join the conversation.
- pl7i92
- Offline
- Platinum Member
-
- Posts: 1871
- Thank you received: 358
the user comp just gets it is or it is not
and all GUI gets signaling to show if your axis are homed
eighter axis with a icon
or gscreen gmoccapy with color
Please Log in or Create an account to join the conversation.
- persei8
- Topic Author
- Offline
- Platinum Member
-
- Posts: 399
- Thank you received: 133
sudo apt-get install linuxcnc-dev results in:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linuxcnc-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'linuxcnc-dev' has no installation candidate
I do have the buildbot repository in /etc/apt/sources.list.d/linuxcnc-buildbot.list
If you tell me I have to build it from source, then I am done with it and will just use the python code I have now.
EDIT:
Never mind. Its sudo apt-get install linuxcnc-uspace-dev
Please Log in or Create an account to join the conversation.
- persei8
- Topic Author
- Offline
- Platinum Member
-
- Posts: 399
- Thank you received: 133
except the command is sudo halcompile --install and3.comp
In case anyone wants to know the result of this exercise, the following is in my custom.hal file.
loadrt and3 names=and3_0
net home_x joint.0.homed => and3_0.in0
net home_y joint.1.homed => and3_0.in1
net home_z joint.2.homed => and3_0.in2
net all_homed and3_0.out
addf and3_0 servo-thread
and then
net all_homed gscreen.hal_led_all_homed
in the postgui hal file
The result is that a LED lights up when all 3 axes are homed, without using python code.
Thanks to all for the help. And if you actually want a AND3 component, I attached the comp file.
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
persei8 wrote: It worked!
except the command is sudo halcompile --install and3.comp
Thanks to all for the help. And if you actually want a AND3 component, I attached the comp file.
Great work. Sorry about the wrong example. Its funny how it all works when you are typing at the console.
Welcome to the magical world of hal components!
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
- Posts: 19311
- Thank you received: 4655
This is rather useful for interlocks etc. (for example if door is open and spindle is not on and pedal is pressed then release tool).
LUT5 becomes especially interesting when the output is fed back to one of the inpiuts, then it can exhibit useful latching behaviour.
Please Log in or Create an account to join the conversation.
- wasausky
- Offline
- New Member
-
- Posts: 18
- Thank you received: 4
because the revision that I have in the raspberry is not in the list of these components.
my question is:
if I recompile the component, will it be rewritten? Or do you have to create another one?
Also, in the case of the 3 ands, if you recompile the component several times until you finish, you would be rewriting it or creating different components.
Thank you for your answers.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
- Posts: 19311
- Thank you received: 4655
sudo halcompile --install cpuinfo.c
I think that it probably won't work, but it's worth trying.
Please Log in or Create an account to join the conversation.