# Problem with create function with more than 3 inputs.

Forum Home Forums Understanding the Software Using Formulas Problem with create function with more than 3 inputs.

Viewing 4 posts - 1 through 4 (of 4 total)
• Author
Posts
• #5446
gasin
Participant

I’m stuck to create formula with 3 input parameter in function.

public compare(double in1, double in2, double in3)
{
double output = 0;
if(in1==1 && in2==1)
{
in3 = 1;
return in3;
}
else{return output;}
}

and i create input 1003 using formula with : compare(Val(1001),Val(1002),Val(1003))

with this code i got error on web. but if i put only 2 input in function, web will work fine.

so, is it possible to put 3 inputs variable in to function?

#5448
Mikhail
Moderator

is it possible to put 3 inputs variable in to function?

Sure, it’s possible.
Function must have a return type: public double compare(…)
You can find error description in SCADA-Server log.

#5450
gasin
Participant

here is error from server.

2019-05-14 20:02:34 <DESKTOP-1CTUDRI><SYSTEM><ERR> Error compiling the source code of the formulas
Line 742, column 58; error cs1501: No overload for method ‘if2’ takes 2 arguments
2019-05-14 20:02:34 <DESKTOP-1CTUDRI><SYSTEM><ERR> Normal program execution is impossible

i’m create function “if2” with 3 inputs and got this error.

and here is my function.

public if2(double in1,double in2,double in3)
{
if(in1==0 && in2==1)
{in3=1;}
if(in2==0)
{in3=0}
return in3;
}

in1 & in2 are input parameter from register via modbus and in3 is extra input that i create to database to get result from this function.

how can i solve it, please suggest.

#5456
Mikhail
Moderator

At least
public double if2(double in1,double in2,double in3)

Viewing 4 posts - 1 through 4 (of 4 total)
• You must be logged in to reply to this topic.