Variable number of arguments in a user-defined function

Yegor
2012-01-05
2012-01-08
  • Yegor - 2012-01-05

    Is there any way to define a function with a variable number of arguments in Codesys 2.3? You know, like ADD, MUX...

     
  • shooter - 2012-01-07

    NO, however you do not have to use all inputs, so you can make a default block with several inputs and set them default on zero, for example.
    same for outputs you do not have to use them.
    btw how do you think you could program this?

     
  • Yegor - 2012-01-08

    Disclaimer: I'm not sure it's a good idea yet.

    As my current project has only two-state valves in it, I made a universal FB for use with both motorized and solenoid type ones, i.e. FB as a class definition in OOP way (thus FB actions = OOP class methods). So, in SFC transition conditions, I would like to be able to do something like instead of . For this to be possible I need a function capable of accepting arbitrary number of arguments.

     

Log in to post a comment.