changing ethercat SDOs using user panel
- mehdidadash
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 50
- Thank you received: 4
09 Mar 2023 09:38 #266184
by mehdidadash
changing ethercat SDOs using user panel was created 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 :
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.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23244
- Thank you received: 4915
10 Mar 2023 12:42 #266284
by andypugh
Replied by andypugh on topic changing ethercat SDOs using user panel
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.
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.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11161
- Thank you received: 3713
12 Mar 2023 12:52 #266488
by rodw
Replied by rodw on topic changing ethercat SDOs using user panel
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
So it not possible to change SDOs at runtime
Please Log in or Create an account to join the conversation.
- mehdidadash
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 50
- Thank you received: 4
15 Mar 2023 22:20 #266791
by mehdidadash
Replied by mehdidadash on topic changing ethercat SDOs using user panel
Thank you. It will help for sure.
Please Log in or Create an account to join the conversation.
- mehdidadash
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 50
- Thank you received: 4
15 Mar 2023 22:26 #266792
by mehdidadash
Replied by mehdidadash on topic changing ethercat SDOs using user panel
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.
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.
- db1981
- Offline
- Platinum Member
-
Less
More
- Posts: 790
- Thank you received: 275
16 Mar 2023 08:05 #266808
by db1981
Replied by db1981 on topic changing ethercat SDOs using user panel
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....
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.
- mehdidadash
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 50
- Thank you received: 4
16 Mar 2023 12:11 #266831
by mehdidadash
Replied by mehdidadash on topic changing ethercat SDOs using user panel
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 ?
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.
- gueee78
- Offline
- New Member
-
Less
More
- Posts: 18
- Thank you received: 4
26 Aug 2023 09:39 #279004
by gueee78
Replied by gueee78 on topic changing ethercat SDOs using user panel
Hi mehdidadash!
did you find a solution for your demand, or did you gather any new knowledge?
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.372 seconds