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

SDO_WRITE 4byte Index

stephan-K
2018-05-02
2018-05-30
  • stephan-K - 2018-05-02

    I'm trying to use the CIA405.SDO_WRITE4 function to write a SDO to a device. My issue is the index input (SDO_WRITE4.INDEX) is of type WORD but I am trying to write a SDO in the Manufacturer Specific range (ie index 16#5999). This index value is 4 bytes but a WORD is only 2.

    Im getting SDO_WRITE4.ERRORINFO 101122066 or 0607 0012h which from the abort code represents: "Data type does not match; length of service parameter too high."

    Any ideas? Is there another way to write higher indices SDO?

    Thanks.

     
  • TimvH

    TimvH - 2018-05-10

    An SDO message is 8 bytes in total:
    1 for the command
    2 for the index
    1 for the sub-index
    4 for the data bytes

    The maximum value of a WORD is 16#FFFF, this means you can also access index 16#5999

     
  • josepmariarams - 2018-05-12

    The error is about the variable that you try to write, try with write8 or write2.

    Enviat des del meu Aquaris M5.5 usant Tapatalk

     
  • josepmariarams - 2018-05-12

    Sorry. Via sdo you cant write an 8bytes message.

    Try with write2 or write 1

    Enviat des del meu Aquaris M5.5 usant Tapatalk

     
  • stephan-K - 2018-05-30

    Thank you for the feedback.

    It was en error to do with the data variable being written. With SDO_WRITE I needed to dynamically change WRITE_SDO.Datalength variable based on data type being transmitted.

     

Log in to post a comment.