- Posts: 210
- Thank you received: 0
(SOLVED - maybe) How to get an underscore in a pin/parameter name?
forum.linuxcnc.org/24-hal-components/347...?limitstart=0#112343
Please Log in to join the conversation.
- ozzyrob
- New Member
-
- Thank you received: 0
Sparky961 wrote:
ozzyrob wrote: I'd be putting my wager on the coder doing something wrong rather than the compiler doing something wrong
...
Just cos a underscore can be used does not necessarily mean it should.
Not at all helpful.
Yes you are right in that context probably not....but you did decide to leave out this bit as to why it might be an error on the coder's part.
ozzyrob wrote: Make sure that all the component names in the file match the source file name...I got the same behavior when I copied the supply.c src to supply_2.c and didn't change any reference to supply to supply_2.
Please Log in to join the conversation.
ozzyrob wrote: Yes you are right in that context probably not....but you did decide to leave out this bit as to why it might be an error on the coder's part.
I left it out because a few posts later my course changed and I'm not trying to compile an existing file with changed names anymore.
Keep up mate, you're getting left behind. As confusing as it may be to those who might be gracious enough to help me, I can't possibly wait helplessly for people to respond. I have to keep trying things and move forward.
As to the argument of whether or not to use an underscore, it isn't my choice. The existing component I'm trying to make a "dummy" of has names with underscores.
The present issue, also mentioned previously in this thread, is that I can't seem to get a working component through the two-step process of using halcompile to preprocess the *.comp file, then 'halcompile --install' the generated C file after changing only one character in the file - the dash to an underscore.
I'll be investigating that one after I submit this. That, or I might do something more useful since this was supposed to be yet another "quick side project".
Please Log in to join the conversation.
Are there different versions of components, halcompile, and whatever else needed to build components for 'uspace' or for the rt-preempt kernel I installed? If so, how to I verify what I have and correct any mismatch?
Please Log in to join the conversation.
I make a file, 'and5.comp' that's in the component generator language:
Then I run the following:
Ok, all seems well. Then I try to load it in HAL:
...ok, this also seems to be working fine.
Now when I try to do it in two steps:
Then only preprocess:
Results in hm2_7i76e.c being created as below:
Now I change only the dash in the name on line 56 to an underscore and try to compile the C file:
No nasty errors. Seems like it worked.
Now, as before, I try to load the component in HAL:
Well I'll be a ...... damn. I swear that wasn't happening last night. It would try to load and never succeed.
Seems I don't need help on this anymore for the time being. Unless I can reproduce the problem, it seems.
Please Log in to join the conversation.
- ozzyrob
- New Member
-
- Thank you received: 0
r = hal_param_s32_newf(HAL_RO, &(inst->watchdog_timeout_ns), comp_id,
"%s.watchdog.timeout-ns", prefix);
As seen here in blue:
r = hal_param_s32_newf(HAL_RO, &(inst->watchdog_timeout_ns), comp_id,
"%s.foofoo.dog_woof", prefix);
halcmd: loadrt hm2_7i76e
Note: Using POSIX realtime
halcmd: show
Loaded HAL Components:
ID Type Name PID State
6 RT hm2_7i76e ready
4 User halcmd9484 9484 ready
Component Pins:
Owner Type Dir Value Name
6 bit IN FALSE hm2-7i76e.0.in0
6 bit OUT FALSE hm2-7i76e.0.out0
6 s32 OUT 0 hm2-7i76e.0.time
Pin Aliases:
Alias Original Name
Signals:
Type Value Name (linked to)
Parameters:
Owner Type Dir Value Name
6 s32 RO 5000000 hm2-7i76e.0.foofoo.dog_woof
6 s32 RW 0 hm2-7i76e.0.tmax
6 bit RO FALSE hm2-7i76e.0.tmax-increased
Parameter Aliases:
Alias Original Name
Exported Functions:
Owner CodeAddr Arg FP Users Name
00006 7f158155bcb0 7f1582d640d8 YES 0 hm2-7i76e.0
Realtime Threads:
Period FP Name ( Time, Max-Time )
halcmd: quit
Note: Using POSIX realtime
Please Log in to join the conversation.
The real HAL file with the real 7i76 will have "hm2_7i76" (maybe hm2_7i76e" I haven't seen one)
Please Log in to join the conversation.
andypugh wrote: Do you want pins "hm2_7i76" or "hm2-7i76" ?
The real HAL file with the real 7i76 will have "hm2_7i76" (maybe hm2_7i76e" I haven't seen one)
Yes, you're right. I was so focused on the one I didn't see the other.
Please Log in to join the conversation.
