I am stuck, pretty new at c "like" programming.
Trying to have a program run some comparisons to setpoints and variable data that comes in from a radio network via modbus to a Redlion HMI to run other programs and or trigger tags. The problem is if one set of instructions run it can disrupt the rest of the program. I want my sensors to start and stop a pump based on Temperature and/OR Moisture, Using one D/O on a radio to then trigger a customers controller. I know I am close, I have had it working with just Temps before. or just Moisture. Just cant get my statements right. help
if ((Field_K1.Temp_Low_Mon <= Targets.Low_Frost_SetPoint)||
(Field_K1.Temp_Low_Mon >= Targets.High_Heat_SetPoint))
{PumpsK1_S4.Temp_OnK1();
return;}
else if (Field_K1.Irrometer >= Targets.Irrometer_SetPoint_High)
{PumpsK1_S4.Water_OnK1();
return;}
else if ((Field_K1.Temp_Low_Mon >= Targets.High_Frost_SetPoint)&&
(Field_K1.Temp_Low_Mon <= Targets.Low_Heat_SetPoint))
PumpsK1_S4.Temp_OffK1();
if (Field_K1.Irrometer <= Targets.Irrometer_SetPoint_Low)
PumpsK1_S4.Water_OffK1();
Not sure how to use a switch statement if that would help.
Thank you.
Trying to have a program run some comparisons to setpoints and variable data that comes in from a radio network via modbus to a Redlion HMI to run other programs and or trigger tags. The problem is if one set of instructions run it can disrupt the rest of the program. I want my sensors to start and stop a pump based on Temperature and/OR Moisture, Using one D/O on a radio to then trigger a customers controller. I know I am close, I have had it working with just Temps before. or just Moisture. Just cant get my statements right. help
if ((Field_K1.Temp_Low_Mon <= Targets.Low_Frost_SetPoint)||
(Field_K1.Temp_Low_Mon >= Targets.High_Heat_SetPoint))
{PumpsK1_S4.Temp_OnK1();
return;}
else if (Field_K1.Irrometer >= Targets.Irrometer_SetPoint_High)
{PumpsK1_S4.Water_OnK1();
return;}
else if ((Field_K1.Temp_Low_Mon >= Targets.High_Frost_SetPoint)&&
(Field_K1.Temp_Low_Mon <= Targets.Low_Heat_SetPoint))
PumpsK1_S4.Temp_OffK1();
if (Field_K1.Irrometer <= Targets.Irrometer_SetPoint_Low)
PumpsK1_S4.Water_OffK1();
Not sure how to use a switch statement if that would help.
Thank you.