CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Fri Nov 22, 2019 1:49 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Sep 12, 2013 10:12 am 
Offline

Joined: Fri Nov 23, 2012 11:42 am
Posts: 54
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.


Top
   
PostPosted: Sat Sep 14, 2013 10:07 am 
Offline
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 986
call it as a function block that can have inputs.

_________________
shooter@home.nl
computer shooter
paul deelen
jacob van wassenaerstraat 29
NL 5224 GG 's-Hertogenbosch
skype shooter paul.deelen
phone +31736139136


Top
   
PostPosted: Tue Oct 29, 2013 10:12 pm 
Offline

Joined: Fri Nov 23, 2012 11:42 am
Posts: 54
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?


Top
   
PostPosted: Tue Oct 29, 2013 10:24 pm 
Offline
Frequent User
Frequent User
User avatar

Joined: Tue Jun 06, 2006 9:03 am
Posts: 410
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).


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited