HALCMD | Pin renaming

More
07 Oct 2021 07:11 #222430 by juniorfi
Hello,

I would like to know what is the best way to "remap" the pin names.

Let's day for example I have lcec.0.7.serv-1-cmd and I would like to rename as motor_2_value.
How I can do that, instead creating a new empty LCEC empty driver?

I tried using net and loadrt parameters as I saw in some examples with a Joystick. but I haven't go that working.



Regards    

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

More
07 Oct 2021 08:32 #222432 by db1981
Replied by db1981 on topic HALCMD | Pin renaming
There is no way to rename HAL Pins, only recompiling....

You can give them an "alias" with the net command.
You can create an second hal_file "ethercat_io.hal" with all lcec pins and give them nets with "nice" names.

net motor_2_value lcec.0.7.serv-1-cmd
net x-limit-pos-in lcec.xxxx

then you can use that net names in your main hal file for better viewing..

net motor_2_value joint.x.xxxx


Do you know the name command for lcec slaves?

If you add the name to your ethercat-conf.xml :

<slave idx="7" type="EL7342" name"motor_2" />

then the pins from this slave will be named the following way:

lcec.0.motor_2.serv-1-cmd

you can also give the master a name:

lcec.master_name.motor_2.serv-1-cmd

Maybe, this is helpfull.

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

More
07 Oct 2021 16:28 - 07 Oct 2021 16:30 #222466 by Todd Zuercher
Replied by Todd Zuercher on topic HALCMD | Pin renaming
Many hal components have an option parameter that allows you to designate alternate names for some of their pins. You would need to check the man page for each component you want to rename and see if it is implemented for it and how it works. (It may not give you all the naming flexibility you desire.)

PS. generally I find using these renaming options usually adds more complexity and confusion than they solve.
Last edit: 07 Oct 2021 16:30 by Todd Zuercher.

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

More
07 Oct 2021 21:03 #222489 by andypugh
Replied by andypugh on topic HALCMD | Pin renaming
As said above, you can often use names=. For example:
loadrt and2 names=snap,crackle,pop

Then the pins that would normally be and2.0.in0 would be snap.in0

But, there is also the HAL "alias" command:
linuxcnc.org/docs/2.8/html/man/man1/halcmd.1.html

Which sounds like exactly what you want.
The following user(s) said Thank You: bob8020

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

Time to create page: 0.063 seconds
Powered by Kunena Forum