# Could you help to make correct logic.

Forum Home Forums Understanding the Software Using Formulas Could you help to make correct logic.

Viewing 3 posts - 1 through 3 (of 3 total)
• Author
Posts
• #5451

Hi.
there are 2 inputs and 1 output.
my purpose
if input1 = off and input2 = on , my output will be on after that my output will alway on even though input1 change on/off. the only way to make my output off is input 2 must off then my output = 0.

this is my formula
public double inputtest(double in1,double in2)
{
double output = 0;
int a = 0;
if(in1 == 0 && in2 > 0 && a == 0){
output = 1;
a = 1;
}
if(a == 1 && in2 == 0){
output = 0;
a = 0;
}
return Convert.ToDouble(output);
}

Thank you so much.

#5452

Tell me, why do you then need to input 1 ?

#5453

Thank you so much
I use this formula and it work fine.
public double ifS(double in1,double in2,double in3)
{
double output = in3;
if(in1 == 0 && in2 == 1){
output = 1;
}else if(in2 == 0){
output = 0;
}
return output;
}

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