Axis EtherCAT address

fgarcia
2025-03-06
2025-03-07
  • fgarcia - 2025-03-06

    Hello,

    I'd like to write some parameters to axes from inside a function block where I passed axis by reference, using ETC_CO_SdoWrite. Is it possible to get the device address from inside the function block?

    Please see example below.

    Thank you!

     
  • ph0010421 - 2025-03-07

    Hello
    SDO will write to the drive, not the axis, so you need to pass in the ethercat slave:

    VAR_IN_OUT
    Axis: IoDrvEthercatLib.ETCSlave;
    END_VAR

    Then you can get the address with:

    Axis.PhysSlaveAddr (as UINT)

     

    Last edit: ph0010421 2025-03-07
    • fgarcia - 2025-03-07

      Hello,

      Thank you for your answer.

      I'm afraid I was not clear on what I was trying to achieve.

      I'm trying to change parameters and command axes from inside a function block and the first thing that came to my mind was pass both the EtherCAT slave and axis to the function block (as image attached). But, I believe it's worse than just pass directly the EtherCAT slave address to the function block (is it???). However I was wondering if there was a way to get the EtherCAT address directly from the axis, so I don't need to pass the EtherCAT slave nor the EtherCAT address to the function block.

      Thank you again!

       

      Last edit: fgarcia 2025-03-07

Log in to post a comment.