Forward a VAR_IN_OUT to a sub block :?:

Johan
2012-01-31
2012-02-01
  • Johan - 2012-01-31

    Hi
    Is there anyway to forward a "VAR_IN_OUT" variable to a "VAR_IN_OUT" of a sub function block.
    Example:
    Function block FB1 has an "VAR_IN_OUT" called INOUT1
    Inside FB1 is a call to another function block FB2 that has an "VAR_IN_OUT" called INOUT2. Is there any way to pass forward INOUT1 to INOUT2? Provided they are of the same TYPE .

    Target settings
    VAR_IN_OUT as reference: activated.

    Regards
    Johan

     
  • Johan - 2012-02-01

    Solved!!

    (Code like this does NOT work)
    ( Error 4062: No external access to 'VAR_IN_OUT' parameter.........)
    STATUSFB.STATUS2:=INOUT2;
    STATUSFB();

    Since no external refrence to a VAR_IN_OUT is possible it must be declared inside the () of the function block call.
    (But this work)
    STATUSFB(
    STATUS2:=INOUT2,
    );

    Regards
    Johan

     

Log in to post a comment.