Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Mapping of Array Element to a EtherCAt Slave variable

Thillai
2018-07-06
2018-07-25
  • Thillai - 2018-07-06

    Is it possible to map array element to a EtherCAT Slave variable. I am trying to communicate with a EtherCAT HMI to read the floating variable. So I need to convert them in codesys from udint to real using arrays and union. I am trying to do with array. But I can't able to map them in I/O Mapping to EtherCAT Slave. Is there anyway I can map the array element to the EtherCAT HMI Variable?.

     
  • TURCKONE - 2018-07-10

    hello ,

    you can use for loop to transfer entire array from one to another

    for i=0 to 10

    ethecat_variables_array[i]=your_array_you_want_to_copy[i];

    end_for

     
  • Thillai - 2018-07-11

    My problem is I can't able to map the array elements to ethercat variables

     
  • TURCKONE - 2018-07-11

    is it possible to attach program?
    how many ethercat variables you need to convert?

    define array in variables list like :

    CH0_RX_Array_Eth AT %QB210: ARRAY [0..29] OF BYTE;

     
  • Thillai - 2018-07-12

    Hi TURCKONE
    Thank you for your response. It helps me. I am using 256 bytes of read and 256 bytes of write with float as data type.
    I was trying to upload my project. It took long time and not successful.

     
  • TURCKONE - 2018-07-16

    is it working now ?

    thanks ,

     
  • Thillai - 2018-07-25

    Yes. It is working now.Thank you for your suggestion.

     

Log in to post a comment.