mkelly Posted July 23, 2012 Share Posted July 23, 2012 I have a compressor that chills some refrigerant. I want it to fluctuate around the setpoint. So say my setpoint is -10C. I'll set my offset to 2.5C This means that when the temperature of my coolant is above -7.5C the compressor will kick on and stay on until it's at -12.5C I don't want the compressor to turn back on again until the coolant is above -7.5 again. I thought I could do this with two If statements nested together but it's not working properly. //initilize relay to 0 Chiller = 0 Chiller_Offset = 2.5 //if/then to open valve for 1/2 second if liquid dP is too low if(Mean(Coolant_In[0,3])>(V.Coolant_Setpoint + Chiller_Offset)) Chiller = 5 if(Mean(Coolant_In[0,3])<(V.Coolant_Setpoint - Chiller_Offset)) Chiller = 0 Endif Endif Advice on this will be greatly appreciated Link to comment Share on other sites More sharing options...
AzeoTech Posted July 24, 2012 Share Posted July 24, 2012 Your close. You don't want to nest the if's. Make them independent. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.