Call program with VAR_INPUT from task

2013-09-12
2013-10-29
  • DavidCozens

    DavidCozens - 2013-09-12

    I have a program defined in a library that is related to a device driver. I want to be able to invoke the same program from multiple tasks passing a different argument in each case. The argument would be a handle related to the device driver and would come from a GVL.

    When I add the program to a task the "Insert with Arguments" box is ticked - but greyed out.

    I can work around this by having multiple program instances - but this is much less elegant.

     
  • shooter

    shooter - 2013-09-14

    call it as a function block that can have inputs.

     
  • DavidCozens

    DavidCozens - 2013-10-29

    I've just come back to this, I found another way of solving my problem, however your response interests me. Is it possible to directly call a function block directly from a task in codesys 3.5? I know that it is possible according to the IEC language specification, but then so is calling a program with a VAR INPUT (I think).

    When I try to add a call to a POU to a task I can only select program objects and I cannot add arguments, am I missing something?

     
  • timvh

    timvh - 2013-10-29

    The input assistent Window which you get to see is a general Window which you get to see everytime you use this (e.g. press F2 in one of the editors). It might be misleading to think that you can call programs from the task with arguments, because you can't.
    You also cannot call FB's or FUN's from a Task.

    You can call programs with arguments (VAR_INPUT, VAR_IN_OUT), but only from other program's (or FB's, but this is not very logical).

     

Log in to post a comment.