Sign in to follow this  
Followers 0
BrunoRamos

Function blocks without defining Inputs and Outputs data type

5 posts in this topic

Hi,

I have quite a noobie question.

I want to create a function block to do some simple operations on 2 variables. Both variables are In/Outs (see picture attached).

How can I make this function accept variables regardless of the data type? Given these is just simple math I am able to use the same instructions in REAL, INT, UINT, etc. But, the function block only lets me assign one Data Type to the In/Out variables.

Share this post


Link to post
Share on other sites

When comparing to system functions (for example the MOVE instruction) the Data Types are defined as ANY. But this is not accepted when I try to create a Function or Function Block by myself,

Share this post


Link to post
Share on other sites

When creating function block inputs and outputs, you must specify one data type.  You cannot do things like the internal blocks that will select ANY data type.  Function block inputs and outputs are created by creating a variable, and a variable can only be one data type.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0