- Configuring LinuxCNC
- HAL
- How to loadrt multiple places with additional instances lk machinekit instcomp
How to loadrt multiple places with additional instances lk machinekit instcomp
25 Feb 2022 17:24 #235803
by yeltrow
How to loadrt multiple places with additional instances lk machinekit instcomp was created by yeltrow
Does anyone have any workarounds for getting multiple loadrt lines in .hal files so they do not conflict when they need the same modules? Machinekit has a workaround called instcomp which allows additional instances of a component to be incrementally added later.
www.machinekit.io/docs/hal/instcomp/
I would like to have the various hal files for my machine load their module dependencies and names on their own without crashing because the modules are already loaded. This is for the goal of code abstraction and configuration file reuse. It comes up in the context of me wanting to migrate my machine configuration from a parallel port configuration to a Mesa 7i76e and undoing the decade of config file sins I have committed (via git at github.com/yeltrow/theshiz )
I know I can put:
loadrt sum2 names=snazzysummer,dumbfilesummer
but that doesn't achieve a level of abstraction that could be useful. When do I see wanting that? To make things like PNCConf spit out a base set of definitions for things like pid loops that I can just add my configs to instead of needing go back and hand edit them.
for example in
#somethingsnazzy.hal
loadrt sum2 names=snazzysummer
#dumbfile.hal
loadrt sum2 names=dumbfilesummer
and then in mymachine.ini
[HAL]
HALFILE = somethingsnazzy.hal
HALFILE = dumbfile.hal
Maybe some sort of pre-processor?
Thank you very much for your thoughts. I really appreciate it!
I would like to have the various hal files for my machine load their module dependencies and names on their own without crashing because the modules are already loaded. This is for the goal of code abstraction and configuration file reuse. It comes up in the context of me wanting to migrate my machine configuration from a parallel port configuration to a Mesa 7i76e and undoing the decade of config file sins I have committed (via git at github.com/yeltrow/theshiz )
I know I can put:
loadrt sum2 names=snazzysummer,dumbfilesummer
but that doesn't achieve a level of abstraction that could be useful. When do I see wanting that? To make things like PNCConf spit out a base set of definitions for things like pid loops that I can just add my configs to instead of needing go back and hand edit them.
for example in
#somethingsnazzy.hal
loadrt sum2 names=snazzysummer
#dumbfile.hal
loadrt sum2 names=dumbfilesummer
and then in mymachine.ini
[HAL]
HALFILE = somethingsnazzy.hal
HALFILE = dumbfile.hal
Maybe some sort of pre-processor?
Thank you very much for your thoughts. I really appreciate it!
Please Log in or Create an account to join the conversation.
25 Feb 2022 17:45 #235807
by Aciera
Replied by Aciera on topic How to loadrt multiple places with additional instances lk machinekit instcomp
Maybe 'twopass' could give you what you want:
linuxcnc.org/docs/html/hal/twopass.html
linuxcnc.org/docs/html/hal/twopass.html
The following user(s) said Thank You: yeltrow
Please Log in or Create an account to join the conversation.
25 Feb 2022 18:15 #235810
by yeltrow
Replied by yeltrow on topic How to loadrt multiple places with additional instances lk machinekit instcomp
Brilliant! Thank you so much. The caveats are perhaps a little dicey, but that should enable the abstraction I'm looking for.
I wonder if it is crazy to implement and architectural change where linuxcnc always renames copies of the modules it inserts into the kernel so there aren't conflicts? I know that means more kernel memory due to unnecessary copies, but memory is kinda cheap these days. (like modprobe -o? )
I wonder if it is crazy to implement and architectural change where linuxcnc always renames copies of the modules it inserts into the kernel so there aren't conflicts? I know that means more kernel memory due to unnecessary copies, but memory is kinda cheap these days. (like modprobe -o? )
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- HAL
- How to loadrt multiple places with additional instances lk machinekit instcomp
Time to create page: 0.068 seconds