Ethercat processdata control

2016-05-15
2016-08-01
  • juhataipale - 2016-05-15

    Hello all,

    This is maybe more ethercat-related, but I am sure someone here knows how to deal.

    I have a Beckhoff EL3403 -energymeter unit, working smoothly.
    Just now I am having hard times, because I should work with the process data.

    For example:
    The unit is counting energyconsumption by itself whenever running and saving result to its own persistent data bank.
    Monitoring the value is easy, since it is one of the default variables in mapping list.

    But I want to reset the value from command and this should be done by "entering 0004hex to index 0xFB00:01.
    What does this actually mean and how to proceed?

    Do I need to add this index to process data inputs to be able to map it and then set the value?
    I already tried, but I was not succesful. (After download the bus is not going up)

    -Juha

    IMG: request.JPG

     
  • juhataipale - 2016-05-22

    So, after reading manuals all over, I found what I need, but still not getting it to work...

    So, in this case the dataflow between Master and Slave is CanOpen over EtherCAT ( CoE ).
    Only way to change the value is to either set Startup value or Write the process data.

    So, with codesys-package there comes this IODrvEtherCAT -library.
    There is a function block "ETC_CO_SdoWRITE4" with which you can write values to process data.

    So,
    to delete the energy values of all channels manually enter 0004hex in index 0xFB00:01

    I enter following values to my CoE-writer:
    xExecute = TRUE
    xAbort = empty
    usiCom = 1 (Number of Ethercat master)
    uiDevice = 1005 (Number of the slave device)
    usiChannel = empty
    wIndex = 64256 (FB00 -> decimal because datatype WORD)(should it be like this???)
    bySubindex = 1
    udiTimeOut = 500 (ms)
    abyData = 4 *HOW TO WRITE THAT 0004hex here?? datatype should be ARRAY [1,,4] OF BYTE
    usiDataLength = 2
    ?* datatype should be USINT

    Do I need to do something else to get this work, like take some global variable from that IODrvEtherCAT -library or something else.

    //EDIT:wrong picture

    -Juha

    IMG: ADS_kommu_block.JPG

     
  • juhataipale - 2016-06-06

    juhataipale hat geschrieben:
    So, after reading manuals all over, I found what I need, but still not getting it to work...
    So, in this case the dataflow between Master and Slave is CanOpen over EtherCAT ( CoE ).
    Only way to change the value is to either set Startup value or Write the process data.
    So, with codesys-package there comes this IODrvEtherCAT -library.
    There is a function block "ETC_CO_SdoWRITE4" with which you can write values to process data.
    ADS_kommu_block.JPG
    So,
    to delete the energy values of all channels manually enter 0004hex in index 0xFB00:01
    I enter following values to my CoE-writer:
    xExecute = TRUE
    xAbort = empty
    usiCom = 1 (Number of Ethercat master)
    uiDevice = 1005 (Number of the slave device)
    usiChannel = empty
    wIndex = 64256 (FB00 -> decimal because datatype WORD)(should it be like this???)
    bySubindex = 1
    udiTimeOut = 500 (ms)
    abyData = 4 *HOW TO WRITE THAT 0004hex here?? datatype should be ARRAY [1,,4] OF BYTE
    usiDataLength = 2
    ?* datatype should be USINT
    Do I need to do something else to get this work, like take some global variable from that IODrvEtherCAT -library or something else.
    //EDIT:wrong picture
    -Juha

    Got it work, so maybe this can help someone...

    Remember to use trigger in execute input!
    See photo below, how to proceed the rest.

    IMG: kirjoitus.JPG

     
  • zahoorahmed - 2016-08-01

    juhataipale hat geschrieben:
    So, after reading manuals all over, I found what I need, but still not getting it to work...
    So, in this case the dataflow between Master and Slave is CanOpen over EtherCAT ( CoE ).
    Only way to change the value is to either set Startup value or Write the process data.
    So, with codesys-package there comes this IODrvEtherCAT -library.
    There is a function block "ETC_CO_SdoWRITE4" with which you can write values to process data.
    ADS_kommu_block.JPG
    So,
    to delete the energy values of all channels manually enter 0004hex in index 0xFB00:01
    I enter following values to my CoE-writer:
    xExecute = TRUE
    xAbort = empty
    usiCom = 1 (Number of Ethercat master)
    uiDevice = 1005 (Number of the slave device)
    usiChannel = empty
    wIndex = 64256 (FB00 -> decimal because datatype WORD)(should it be like this???)
    bySubindex = 1
    udiTimeOut = 500 (ms)
    abyData = 4 *HOW TO WRITE THAT 0004hex here?? datatype should be ARRAY [1,,4] OF BYTE
    usiDataLength = 2
    ?* datatype should be USINT
    Do I need to do something else to get this work, like take some global variable from that IODrvEtherCAT -library or something else.
    //EDIT:wrong picture
    -Juha

    Hello Juha,

    I am new to CoDeSys. Can you please tell me how to access IODrvEtherCAT library through CoDeSys Engineering so that I can access the FB you mentioned.

    Thanks and Kind Regards
    Zahoor

     

Log in to post a comment.