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

using ETCSlave as an FB's inout parameter

alejho
2019-06-28
2019-07-10
  • alejho

    alejho - 2019-06-28

    Hi all,
    I imported the ESI file of my device (it's an inverter) in my project.
    Automatically an ETCSlave instance was generated by the system.

    To manage this inverter I would like to create an FB that accept as inout the whole ETCSlave but, internally in my FB, I don't know how to handle the in/out of my ETCSlave.

    I tried with the pointers to input/output data (".InputData" and ".OutputData") but it seems that I just have read access in this way (may be I'm wrong!)

    There is any way to do this?
    Thank you in advance for any kind of help!

     
  • Anonymous - 2019-07-05

    Originally created by: rickj

    Define an input parameter (eg Slave) of type ETCSlave. he inside the FB you an access the ETCSlave instance using Slave.Parameter, Slave.Method(...), etc.

     
  • alejho

    alejho - 2019-07-10

    Thank you for your answer...of course it's what I tried to do!
    The point is that if the slave has (suppose) a given ethercat i/o mapping:

    %QW0
    %QW1
    ...
    ...
    %IW0
    %IW1

    It seems there's no way to access the i/o data of the ETCSlave passed as in/out parameter at the FB from inside the FB itself.

    It's not difficult to find a workaround for this...but I would like to create an FB that hide all the implementation details to the programmers that will use it in the future!
    Thank you again!
    Ciao!

     

Log in to post a comment.