CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sat Aug 19, 2017 5:38 pm

All times are UTC+01:00




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

Joined: Tue Dec 10, 2013 9:00 am
Posts: 17
Hello,
Is there a possibility to overload a function block to accept a REAL, an INT or a BOOL variable type input?
I mean 'one block to rule them all', so that no different FB names are required.


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

Joined: Thu Jun 14, 2007 9:49 am
Posts: 974
You can make a function block with several inputs of different types, and internally knot them to something making sense, but it is impossible that one input accepts different types of variables.

then it is just a matter of correct connecting, and you will have only one type of FB.

_________________
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:50 am 
Offline

Joined: Tue Dec 10, 2013 9:00 am
Posts: 17
Your idea is completely opposite to my concept. If I wanted to do that, I would rather make multiple function blocks, one per each data type.
But really the case is to have one function or function block that serves multiple data types, because the function/function block will not know which data is passed.


Top
   
PostPosted: Sat Oct 15, 2016 7:57 pm 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 149
Use input type any.


Top
   
PostPosted: Sat Oct 15, 2016 10:17 pm 
Offline
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 974
you can use a pointer to the input and jst grab anything that is on your pointer.

_________________
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  [ 5 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 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