changing ethercat SDOs using user panel

More
09 Mar 2023 09:38 #266184 by mehdidadash
is it posible to change drives SDOs using user panel ?
i mean, sending a comand using hal 
for example :
a button that sends this comand :
ethercat upload -t int32 -p 0 0x2001 0 0

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

More
10 Mar 2023 12:42 #266284 by andypugh
Maybe....

You can set buttons that set a HAL pin to run MDI commands, then the MDI command can be a user-defined M-code that can be any executable file. It's a bit convoluted, but it works.
linuxcnc.org/docs/stable/html/config/ini....html#_halui_section
and
linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m100-m199

Alternatively the GladeVCP and probably QTVCP allow you to embed code directly in the button.
linuxcnc.org/docs/stable/html/gui/gladev...on_widgets_reference
And, any normal UI element can call handler code in the backend file to do the same thing, possibly with the Python os.system("ethercat upload -t int32 -p 0 0x2001 0 0")

Or, you could use a custom HAL component (I wuld probably use Python Userspace) that has HAL pins that connect to the buttons and sends the commands when the pin values change. This approach would (probably) work best for physical hardware buttons, though the MDI_COMMAND approach can also work that way.

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

More
12 Mar 2023 12:52 #266488 by rodw
My understanding is in the ethercat world SDOs are set on startup and PDOs can be dynamically changed.
So it not possible to change SDOs at runtime

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

More
15 Mar 2023 22:20 #266791 by mehdidadash
Thank you. It will help for sure.

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

More
15 Mar 2023 22:26 #266792 by mehdidadash
The idea came to my mind after i find this :
github.com/sittner/linuxcnc-ethercat/blo...c/lcec_deasda.c#L175
Ecrt_slave_config_sdo8
Changes 0x6060 sdo in delta asda c file.

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

More
16 Mar 2023 08:05 #266808 by db1981
these lines are executed at config time (preop state), in front of starting the realtime thread (op state) .

You can readout sdos per terminal everytime, for writing there is more complex code needed.

github.com/steup-engineering/linuxcnc-et.../lcec_class_rt_sdo.c

github.com/steup-engineering/linuxcnc-et.../src/lcec_nanopd4e.c

this is an slave, where i added all neccesary pdos for drive tuning/setup , to change them online from lcnc.

With etherlab master you have to know which sdos you want to access and must add memory addresses for them at setup state....
The following user(s) said Thank You: mehdidadash

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

More
16 Mar 2023 12:11 #266831 by mehdidadash
may i use this codes ?
lcec_class_rt_sdo.c  
i am working on this field for 6 months and to be honest, i know nothing yet.   because i know nothing about c language. i am using your cia402 library now, but is there a way to link this  lcec_class_rt_sdo.c   to cia402.comp ?

these lines are executed at config time (preop state), in front of starting the realtime thread (op state) .

You can readout sdos per terminal everytime, for writing there is more complex code needed.

github.com/steup-engineering/linuxcnc-et.../lcec_class_rt_sdo.c

github.com/steup-engineering/linuxcnc-et.../src/lcec_nanopd4e.c

this is an slave, where i added all neccesary pdos for drive tuning/setup , to change them online from lcnc.

With etherlab master you have to know which sdos you want to access and must add memory addresses for them at setup state....

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

More
26 Aug 2023 09:39 #279004 by gueee78
Hi mehdidadash!

did you find a solution for your demand, or did you gather any new knowledge?

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

Time to create page: 0.211 seconds
Powered by Kunena Forum