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

Changeable number of inputs

ert
2016-10-13
2016-10-30
  • ert - 2016-10-13

    Hello,
    For AND block one can use variable number of inputs.
    I would like to create a function block with adjustable number of inputs e.g. of INT (or BOOL) type.
    How to handle it inside the block?

     
  • shooter - 2016-10-13

    In FBD you only can make a fixed number of inputs as you will have to declare them.
    However you can make inputs and dont use them. you can set them in the declaration to a value, and when not used it will default to it.

     
  • ert - 2016-10-14

    shooter hat geschrieben:
    In FBD you only can make a fixed number of inputs as you will have to declare them.
    However you can make inputs and dont use them. you can set them in the declaration to a value, and when not used it will default to it.

    So how is the "AND" block made? Even if it is a function (and not a function block), it handles multiple inputs as defined by a user.
    I am looking for a similar solution.

     
  • shooter - 2016-10-30

    and block is made just as you say it item1 AND item2 AND item3 etc.
    when doing your own functions you can not add them while programming, so do it while defining the FB. you do not have to use all inputs. (you can define the state of them.

     

Log in to post a comment.