Getting error when installing a homebrew component
In the custom_postgui hal file, I typed:
net tool-number <= pumachanger.toolnumber
Once I do that, I get this message:
Debug file information:
Can not find -sec MOT -var MOT -num 1
Can not find -sec IO -var IO -num 1
Can not find -sec LINUXCNC -var NML_FILE -num 1
Can not find -sec EMC -var NML_FILE -num 1
custom_postgui.hal:67: Pin 'toolnumber' does not exist
......
......
By the way, I have added the pumachanger function to the servo-thread by entering the following at the end of the custom_postgui hal file:
addf pumachanger servo-thread
There is no reason to leave adding the component until the end of the postgui file.
It is a realtime component and can be added in the main hal file above the iocontrol linkages.
I would guess that you have referenced a pin before the component was attached to a thread, but need to see the hal files really
regards
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
-
- Posts: 80
- Thank you received: 1
Moving it to the top of the file fixed the problem! Now, I get no error messages and the pumachanger pin maintains the same state as the source pin and signal. Now I've got to make all the other connections to the pumachanger component.
Mr. Technical
Please Log in or Create an account to join the conversation.
This is confusing because I can see those pins and signals listed in the HAL Configuration window if I comment that line out.
By the way, I have added the pumachanger function to the servo-thread by entering the following at the end of the custom_postgui hal file:
addf pumachanger servo-thread
Any ideas on what I'm doing wrong?
It is possible that you are being caught-out by the (undocumented) requirement that the component name and the component filename have to be exactly the same.
Please Log in or Create an account to join the conversation.
It is possible that you are being caught-out by the (undocumented) requirement that the component name and the component filename have to be exactly the same.
Actually it is documented now (a little).
www.linuxcnc.org/docs/html/hal/comp.html#_constant
JT
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
-
- Posts: 80
- Thank you received: 1
I'm getting a new problem now. I worked on and compiled the component for the tool changer. Then, in custom_postgui.hal, I netted its pins to the signals that are connected to the iocontrol (like tool-number, tool-prepare-request, tool-prepare-confirmed, etc.) and to the 7i77 signals.
When I try to open LCNC, I get the following errors (apparently once it tries to load the custom_postgui.hal):
RTAPI: Task 1[XXXXXX] : Fault with vec=14, signo=11 ip=XXXXXXXX
RTAPI: This fault may not be recoverable without rebooting.
Strangely, if I reboot and load halrun, then type the following at the halcmd prompt: loadrt pumachanger, and then do a 'show', I am able to see the pins that the pumachanger component has created. Right after that, I reload LCNC, and still get the same errors.
This makes me think that the problem is with the custom_postgui.hal file and not with the pumachanger component. That's surprising since there's so much more going on in the component than the hal.
Any ideas?
Mr. Technical
Please Log in or Create an account to join the conversation.
This generally indicates an attempt to use an uninitialised pointer.RTAPI: Task 1[XXXXXX] : Fault with vec=14, signo=11 ip=XXXXXXXX
Just doing that doesn't run any code in the component, though.Strangely, if I reboot and load halrun, then type the following at the halcmd prompt: loadrt pumachanger, and then do a 'show', I am able to see the pins that the pumachanger component has created.
Try
halrun
loadrt pumachanger
loadrt threads
addf pumachanger thread1
start
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
-
- Posts: 80
- Thank you received: 1
Thanks for the tip on the unitialized pointer. Any clues on how to find that?
Also, I tried your suggestion to load it from the terminal, and I didn't get any problems, in case that helps narrow this down. Thanks for your quick response!
Mr. Technical
Please Log in or Create an account to join the conversation.
Thanks for the tip on the unitialized pointer. Any clues on how to find that?
Are you compiling all of LinuxCNC, or using comp for the kins?
If you are compiling the whole thing, then:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...15841112a7d0b282a30b
Please Log in or Create an account to join the conversation.
If you are compiling the whole thing, then:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...15841112a7d0b282a30b
Didn't know that had been included, very useful.
If your component is still the same as the last copy you posted, I really would advise bringing the functions inline.
For userspace components, it does not matter, you can have as many functions as you like and it will work OK.
In realtime components, i have found that functions outside of the main one that is polled, often plain do not work or give unexpected results.
It may be due to the way the function stack works, not sure that is compatible with a polled module.
In your code, the functions do not do much, they appear to be more for ease of reading the code.
For instance you could just use if (ls27 == true) in your code, instead of calling turret_is_clamped() and save yourself a push and pop operation into the bargain
If you renamed ls27 to turret_clamped instead, you would retain the legibility, because you could just test if(turret_clamped) etc.
If you still get errors having done this, it will be much easier to work out what line is causing it.
regards
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
-
- Posts: 80
- Thank you received: 1
Unfortunately, I don't know the answer to your question. Here's how I'm set up: I used pncconf to create the main hal file, and so as not to erase the 'extras' that I invariably add in, I placed the calls and nets in the custom_postgui.hal file. I used comp to compile the pumachanger comp. Does this answer your question? If so, does the link that you provided apply to me?
ArcEye:
What do you mean by moving the functions inline? Do you mean one large function that contains everything instead of the internal calls to other functions? I'll probably give that a shot.
Thanks to both of you guys for the help! As you can see, I need it
![:) :)](/media/kunena/emoticons/smile.png)
Mr. Technical
Please Log in or Create an account to join the conversation.