CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Thu Aug 24, 2017 4:03 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Oct 13, 2016 11:04 am 
Offline

Joined: Tue Dec 10, 2013 9:00 am
Posts: 17
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?


Top
   
PostPosted: Thu Oct 13, 2016 7:35 pm 
Offline
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 974
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.

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


Top
   
PostPosted: Fri Oct 14, 2016 7:52 am 
Offline

Joined: Tue Dec 10, 2013 9:00 am
Posts: 17
shooter wrote:
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.


Top
   
PostPosted: Sun Oct 30, 2016 9:21 pm 
Offline
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 974
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.

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


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 2 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