CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

Call program with VAR_INPUT from task
https://forum.codesys.com/viewtopic.php?f=11&t=5436
Page 1 of 1

Author:  DavidCozens [ Thu Sep 12, 2013 10:12 am ]
Post subject:  Call program with VAR_INPUT from task

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.

Author:  shooter [ Sat Sep 14, 2013 10:07 am ]
Post subject:  Re: Call program with VAR_INPUT from task

call it as a function block that can have inputs.

Author:  DavidCozens [ Tue Oct 29, 2013 10:12 pm ]
Post subject:  Re: Call program with VAR_INPUT from task

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?

Author:  TimvH [ Tue Oct 29, 2013 10:24 pm ]
Post subject:  Re: Call program with VAR_INPUT from task

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).

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/