custom.hal loadrt conflicts

More
23 Jan 2019 23:27 #124694 by kramdradoow
It appears that loading a component (ex. scale) in the HAL file and loading the same component in the called CUSTOM.HAL file is not valid.

I have used PnCConf to create my INI and HAL files. The HAL file uses SCALE. Its loaded and added and all is good.

LATHE-TEST.HAL
loadrt scale names=scale.spindle
addf scale.spindle servo-thread

I am using custom.hal to add some functionality. In my custom.hal file I am also trying to use the SCALE component.

CUSTOM.HAL
loadrt scale names=scale.one,scale.two
addf scale.one servo-thread
addf scale.two servo-thread

This results in an error to the effect "scale cannot be loaded" or some such. I can't remember the exact error message.

If I edit the HAL after PnCConf creates it to loadrt and addf with my name used in custom.hal all is good. The following works. No errors. My custom configuration is added and is operational.

LATHE-TEST.HAL
loadrt scale names=scale.spindle,scale.one,scale.two
addf scale.spindle servo-thread
addf scale.one servo-thread
addf scale.two servo-thread

If I try to use the option in the PnCConf tool to add components I get this which also fails. (incidentally the using that option, I see where I can add more of certain components but don't see an option where I can add a "near" component. I need to use "near" in both files also)

LATHE-TEST.HAL
loadrt scale name=scale.spindle
loadrt yada yada yada
loadrt scale names=scale.one,scale.two

This leads me think think that I cannot create a configuration using PnCConf which works with CUSTOM.HAL that requires additional instances of duplicate components. So I'm left with editing the HAL that PnCConf created which then gets overwritten if/when I run it again.

Any assistance is appreciated.

Mark

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

More
23 Jan 2019 23:57 #124696 by cmorley
Replied by cmorley on topic custom.hal loadrt conflicts
Yes you have come to the limit of Pncconf.
The near component was not added to pncconf's component page so you will have to start hand editing. ( it could be but Pncconf is end of life as far as I'm concerned)

Most people get where you are at - Pncconf can't configure everything in linuxcnc.

Chris M

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

More
24 Jan 2019 00:55 #124698 by andypugh

This leads me think think that I cannot create a configuration using PnCConf which works with CUSTOM.HAL that requires additional instances of duplicate components.


That's pretty much the case, yes.

View PnCCOnf as a convenience thing that can only take you so far. There was a time when there was no Stepconf or PnCConf, and everyone had to hand-edit their HAL and INI files. But, then, this is why the files are human-readable.

The files are intended to be hand-edited.

You can maintain the modularity of your HAL files by using "Twopass". This requires that the components that are loaded in more than one HAL file are loaded with "names=" rather than "count="
linuxcnc.org/docs/2.7/html/config/ini-config.html#_hal_section

This isn't a terrible thing, once you learn how to edit your HAL file you will be amazed what you can do and the flexibility that is opened up, far more than any configuration Wizard could ever be coded to allow.

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

More
24 Jan 2019 01:15 #124703 by kramdradoow
Thanks Chris. I am getting more comfortable coding with HAL. I typically do the work by hand after using pncconf to get the basics. This time I was trying to incorporate closed loop spindle control and was having problems so I went back to pncconf for a fresh start then tried to reuse some of my custom stuff.

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

More
24 Jan 2019 01:18 #124705 by kramdradoow
Andy, I have always said that the flexibility is amazing. That flexibility comes with a price which sometimes exceed my capabilities.

Thanks for that tip about "twopass". I just did a quick skim of that. It could let me have my cake and eat it too.

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

Moderators: cmorley
Time to create page: 0.150 seconds
Powered by Kunena Forum