Cannot Addf a custom component. (fails with function not found)

More
10 Jul 2024 21:16 - 10 Jul 2024 21:17 #304846 by rodw
I don't understand this error.
I wrote the attached custom component to decode a MPG I use.
It compiles fine, loadrt works perfectly and the components pins can be seen in halshow at this point
but when I use addf, it raises an error
HAL: ERROR: function 'mypendant' not found
twopass: Error in file ./pendant.hal:
    addf failed
Shutting down and cleaning up LinuxCNC...
Running HAL shutdown script

It does not matter if I use names= or count= when  using loadrt

Any ideas would be really appreciated. I tried decoding this in hal but gave up as its very messy.
Attachments:
Last edit: 10 Jul 2024 21:17 by rodw.

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

More
10 Jul 2024 22:29 #304851 by andypugh
at the command line

halrun
loadrt pendantjog names=mypendant
show funct

will probably answer the question
The following user(s) said Thank You: rodw

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

More
11 Jul 2024 12:56 #304905 by rodw
Thanks Andy but I am still none the wiser
halcmd: loadrt pendantjog names=mypendant
Note: Using POSIX realtime
halcmd: 
halcmd: show funct
Exported Functions:
Owner   CodeAddr  Arg       FP   Users  Name
 

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

More
11 Jul 2024 12:59 #304906 by cornholio
I did that a few years ago, based on the work here github.com/KurtJacobson/RF45-CNC/tree/ma...HAL%20Components/MPG does make the whole mpg setup easier.

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

More
11 Jul 2024 13:01 #304907 by rodw
But if I  do the same thing with say o2, I get an address. What causes i tto be missing?
debian@debian:~/linuxcnc/configs/my_plasma/components$ halrun
halcmd: loadrt or2
Note: Using POSIX realtime
halcmd: show funct
Exported Functions:
Owner   CodeAddr  Arg       FP   Users  Name
 00004  7fd5e7818189  7fd5e69e0120  NO       0   or2.0

halcmd: 

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

More
11 Jul 2024 13:08 #304910 by rodw

I did that a few years ago, based on the work here github.com/KurtJacobson/RF45-CNC/tree/ma...HAL%20Components/MPG does make the whole mpg setup easier.

Well that was interesting. cornholio, your link showed me I was missing this line
github.com/KurtJacobson/RF45-CNC/blob/ma...nts/MPG/mpg.comp#L14
Fixed now thanks!

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

More
11 Jul 2024 13:12 #304911 by cornholio
I just compiled an dloaded your comp and was just going to compare kurt's to yours. You beat me to it.
All the best, makes hal alot more manageable.

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

More
11 Jul 2024 13:19 #304912 by rodw

I just compiled an dloaded your comp and was just going to compare kurt's to yours. You beat me to it.
All the best, makes hal alot more manageable.

Yeh, dunno how I missed that,
The MPG is fine as I did it in Hal 7-8 years ago for this same device but I wanted to enable the Plus and Minus jog buttons that also have a third button to select between low speed and high speed jogging. That was very difficult to do in hal.

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

Time to create page: 0.100 seconds
Powered by Kunena Forum