Comp??

More
04 Aug 2020 09:33 #177204 by Nitram
Comp?? was created 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;

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

More
04 Aug 2020 12:38 #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.

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

More
04 Aug 2020 22:04 #177293 by andypugh
Replied by andypugh on topic Comp??
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

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

More
04 Aug 2020 22:27 #177296 by Nitram
Replied by Nitram on topic Comp??
Yes, I have been getting an annoying message at start up with gmoccapy.
It has a fix, being a comp thus:
///////////////////////////////////////////////////////////////
// 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 or Create an account to join the conversation.

More
04 Aug 2020 23:34 #177307 by tommylight
Replied by tommylight on topic Comp??
That is correct.
The following user(s) said Thank You: Nitram

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

More
05 Aug 2020 01:51 - 05 Aug 2020 02:43 #177332 by Grotius
Replied by Grotius on topic Comp??
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.
Last edit: 05 Aug 2020 02:43 by Grotius.

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

More
05 Aug 2020 19:20 #177414 by Nitram
Replied by Nitram on topic Comp??
Do you mean create those pins within the comp file then later connect those in the HAL file to the appropriate external HAL pins?

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

More
05 Aug 2020 20:50 #177421 by andypugh
Replied by andypugh on topic Comp??

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 or Create an account to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum