- Posts: 210
- Thank you received: 0
Comp??
6 years 2 months ago #177204
by Nitram
This excerpt is from a long thread about half way through quite a while back in time. It refers precisely to my current issue.
Can anyone tell me what "In a comp" could mean? And how to go about setting it up?
Trying to get context on what to do. All I can imagine at this stage that it may be an executable text file which HAL points to? If it is that I think I have a similar file as a timer based oiler for the ways on my mill, but to be truthful I have no idea.
Could you please give me some guidance as to how to implement the below.
Thanks
Marty.
This seems to be a workaround.
In a comp:
///////////////////////////////////////////////////////////////
// Hack the startup warning.
///////////////////////////////////////////////////////////////
if (!is_manual && is_idle && !is_paused && warning_hack_counter++ < 200) // Overflow will not annoy.
mode_manual = true;
Can anyone tell me what "In a comp" could mean? And how to go about setting it up?
Trying to get context on what to do. All I can imagine at this stage that it may be an executable text file which HAL points to? If it is that I think I have a similar file as a timer based oiler for the ways on my mill, but to be truthful I have no idea.
Could you please give me some guidance as to how to implement the below.
Thanks
Marty.
This seems to be a workaround.
In a comp:
///////////////////////////////////////////////////////////////
// Hack the startup warning.
///////////////////////////////////////////////////////////////
if (!is_manual && is_idle && !is_paused && warning_hack_counter++ < 200) // Overflow will not annoy.
mode_manual = true;
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
6 years 2 months ago #177230
by tommylight
Replied by tommylight on topic Comp??
Comp = component
I'll give it a shot at explaining:
component is a piece of software that manages one or more logic/input/output/settings/certain machine behaviour/etc that has to be compiled and installed into LinuxCNC for the purpose of achieving some functionality that does not already exist.
There is a long list of components that come pre-installed and ready for use with LinuxCNC, and they should all be in github, so if you want to take a peak at how they work inside, search the github, but for a short explanation of what each of them does, here is the link:
linuxcnc.org/docs/html/hal/components.ht...d_bitwise_components
And i think that for timers you should not need to write a new comp, there are plenty that can be used or combined, for example timedelay with flip-flop could do that.
I'll give it a shot at explaining:
component is a piece of software that manages one or more logic/input/output/settings/certain machine behaviour/etc that has to be compiled and installed into LinuxCNC for the purpose of achieving some functionality that does not already exist.
There is a long list of components that come pre-installed and ready for use with LinuxCNC, and they should all be in github, so if you want to take a peak at how they work inside, search the github, but for a short explanation of what each of them does, here is the link:
linuxcnc.org/docs/html/hal/components.ht...d_bitwise_components
And i think that for timers you should not need to write a new comp, there are plenty that can be used or combined, for example timedelay with flip-flop could do that.
Please Log in to join the conversation.
6 years 2 months ago #177293
by andypugh
I think that that list is probably incomplete.
The full list can be found by expanding "Realtime components and kernel modules" here: linuxcnc.org/docs/2.8/html/
If you need to write your own then you use halcompile. But need to know basic C to do that.
linuxcnc.org/docs/2.8/html/hal/comp.html
The full list can be found by expanding "Realtime components and kernel modules" here: linuxcnc.org/docs/2.8/html/
If you need to write your own then you use halcompile. But need to know basic C to do that.
linuxcnc.org/docs/2.8/html/hal/comp.html
Please Log in to join the conversation.
6 years 2 months ago #177296
by Nitram
Yes, I have been getting an annoying message at start up with gmoccapy.
It has a fix, being a comp thus:
Hence, given it is already written, I was confirming the process to install.
From my reading I think I get the following:
1. Create a text file <name>.comp pasting the above code into it.
2. Place your comp file in a directory under home then run sudo halcompile --install <name>.comp from a terminal
3. loadrt <name> and addf <name> into HAL file
Does this sound about right?
It has a fix, being a comp thus:
Code:
///////////////////////////////////////////////////////////////
// Hack the startup warning.
///////////////////////////////////////////////////////////////
if (!is_manual && is_idle && !is_paused && warning_hack_counter++ < 200) // Overflow will not annoy.
mode_manual = true;
Hence, given it is already written, I was confirming the process to install.
From my reading I think I get the following:
1. Create a text file <name>.comp pasting the above code into it.
2. Place your comp file in a directory under home then run sudo halcompile --install <name>.comp from a terminal
3. loadrt <name> and addf <name> into HAL file
Does this sound about right?
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
6 years 2 months ago #177307
by tommylight
Replied by tommylight on topic Comp??
That is correct.
Please Log in to join the conversation.
6 years 2 months ago #177332
by Grotius
Hi,
I think above component code will not work without connecting :
- is_manual
- is_idle
- is_paused
- warning_hack_counter
to the linuxcnc world.
About hacking, you could push something inside the gmoccapy file. But Norbert may not be happy. :blink:
github.com/LinuxCNC/linuxcnc/blob/master...gmoccapy/gmoccapy.py
at line 323, insert something like :
self.command(self.cnc.MODE_MANUAL) or maybe
self.command(self.linuxcnc.MODE_MANUAL) could work.
I think above component code will not work without connecting :
- is_manual
- is_idle
- is_paused
- warning_hack_counter
to the linuxcnc world.
About hacking, you could push something inside the gmoccapy file. But Norbert may not be happy. :blink:
github.com/LinuxCNC/linuxcnc/blob/master...gmoccapy/gmoccapy.py
at line 323, insert something like :
self.command(self.cnc.MODE_MANUAL) or maybe
self.command(self.linuxcnc.MODE_MANUAL) could work.
Please Log in to join the conversation.
6 years 2 months ago #177421
by andypugh
Yes. Custom components (and built-in components) interact with the rest of LinuxCNC via HAL pins.
(There are exceptions)
Nitram wrote: Do you mean create those pins within the comp file then later connect those in the HAL file to the appropriate external HAL pins?
Yes. Custom components (and built-in components) interact with the rest of LinuxCNC via HAL pins.
(There are exceptions)
Please Log in to join the conversation.
Time to create page: 0.103 seconds
