more than 16 time a components with "names ="

More
14 Aug 2016 13:42 #78738 by Curt007
Hello friends.
I need help about HAL twopass.
I try to clean up my hal files.
I try to use HAL TwoPass and I encounter the following problem:
I use 20 times the AND2 component, and in mode "loadrt names= (with 20 names)" (instead of loadrt count=20") is denied me.
I saw in the dmesg: names: can only take 16 arguments.
is there a way to load more than 16 time a components with "names =" ?
Someone could help me?
Thanks a lot.
Curt

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

More
15 Aug 2016 12:21 #78796 by andypugh

is there a way to load more than 16 time a components with "names =" ?


github.com/LinuxCNC/linuxcnc/blob/master...ls/halcompile.g#L476

Lines 476 and 479

As halcompile is written in C you should be able to change halcompile.py and then re-compile and install and2.comp

But...
I suspect that if you need 20x and2 components then you might want to consider using something else, such as LUT5 or a custom component. why do you need so many of them?

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

More
15 Aug 2016 21:01 #78810 by Curt007
Thanks a lot Andy !
I will study this solution.
I think this is the most clean and nice.
Otherwise, maybe, I can also add with COMP some other and2, by and2A and2B..named.
This will be easier for me.
My problem is that I use some only 2 inputs and's in different parts of hal.
I can not replace them with kind which haves more inputs (like logic).
:)

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

More
15 Aug 2016 21:22 #78811 by andypugh

My problem is that I use some only 2 inputs and's in different parts of hal.
I can not replace them with kind which haves more inputs (like logic).


If they do different things, then you can't combine them, but if they are just in different files, then you can. There is no reason that all inputs to a logic-AND have to be connected in the same file.

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

More
31 Jan 2019 05:49 #125372 by Nico2017
Hi,

should this limitation of 16 items when using the loadrt with names with Two passes been overcome or taken into account into the latest version? Running the 2.8 version, I am still facing this issue.

I was in the same case and had to switch all the items with more than 16 elements to the count= convention. This makes the TWO PASSES feature less usefull and powerfull. I thought that the idea of TWO PASSES was not be limited by the number defined in count that you have to "painfully" update everytime you add a new item on a component. Would be nice if this limitation was no longer existing with the TWO PASSES.

Thank you,

Nicolas
The following user(s) said Thank You: Mike_Eitel

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

More
01 Feb 2019 15:03 #125474 by dgarrett
Added commit (master branch) to provide a command line
option to halcompile (--names=) to alter the default
limit (16) on the number of 'names' instances:

github.com/LinuxCNC/linuxcnc/commit/c0cc...b384328cdc1c0499645c
__________________________________________________________

For a standard component in a RIP build, you can
reinstall a single component using the new --names= option:
$ source scripts/rip-environment
$ cd src/hal/components
$ # example: allow up to 22 'name' instances:
$ halcompile --names=22 --install somename.comp

(Note, for a RIP build, one can change the limits for
*all* halcompile components by changing the value of
MAX_NAMES in src/hal/utils/halcompile.g and rebuilding.
You will have to deal with a file conflict for halcompile.g
when rebuilding after updates to the source tree).

__________________________________________________________
To alter a standard component when using a master branch
deb install (from the buildbot):

1) the (updated) linuxcnc-dev package is required to
make halcompile available.

2) make a local copy the source for any standard component
from the github source tree:

github.com/LinuxCNC/linuxcnc/tree/master/src/hal/components

3) Select the required .comp file, find the link for the raw file
and download the raw .comp file

4) Install the local .comp file using:
halcompile --names=value --install ...

Example for the and2 component with name= limit of 22:
$ mkdir ~/local_comp_files
$ cd    ~/local_comp_files
$ # get the raw and2.comp file:
$ wget https://raw.githubusercontent.com/LinuxCNC/linuxcnc/master/src/hal/components/and2.comp
$ # halcompile with 'names' limit of 22:
$ sudo halcompile --names=22 --install and2.comp
$ # test:
$ halrun
$ loadrt and2 names=a,b,c,...

__________________________________________________________
Note: When using a *local* copy of a standard component, the
installed component will be *overwritten* when an upgraded
deb for LinuxCNC is installed so the steps to rehalcompile
must be repeated. The same problem will occur when
rebuilding a RIP build.

For this eventuality, one could rename the local copy
(example: mv and2.comp And2.comp). It is also necessary to
edit this And2.comp file to change the component name inside
the file from and2 to And2.

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

More
01 Feb 2019 15:24 #125477 by Mike_Eitel
THX
For my understanding:
I have to run that every time after a normal synaptic upgrade run.
Correct?

Mike

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

Time to create page: 0.307 seconds
Powered by Kunena Forum