diff --git a/lighthub/modules/out_modbus.cpp b/lighthub/modules/out_modbus.cpp index eccd70f..ed74b53 100644 --- a/lighthub/modules/out_modbus.cpp +++ b/lighthub/modules/out_modbus.cpp @@ -340,7 +340,13 @@ int out_Modbus::findRegister(int registerNum, int posInBuffer, int regType) { debugSerial<subtype & MB_NEED_SEND)) + settedValue->valueint=param; + } //#endif } } @@ -593,13 +599,14 @@ if (itemParametersObj && itemParametersObj->type ==aJson_Object) aJsonObject *execObj = aJson.getObjectItem(itemParametersObj,suffixStr); if (execObj && execObj->type == aJson_Object) { + /* aJsonObject *polledValue = aJson.getObjectItem(execObj,"@S"); if (polledValue && polledValue->type == aJson_Int && (polledValue->valueint == Value)) { debugSerial<subtype |= MB_NEED_SEND; @@ -608,7 +615,6 @@ if (itemParametersObj && itemParametersObj->type ==aJson_Object) { outValue->valueint=Value; outValue->subtype =regType & 0xF; - if (outValue->type == aJson_Int) polledValue->valueint=Value; //to pevent suppressing to change back to previously polled value if this occurs before next polling } else //No container to store value yet // If no @V in config - creating with INT type - normal behavior - no supress in-to-out @@ -618,6 +624,10 @@ if (itemParametersObj && itemParametersObj->type ==aJson_Object) outValue = aJson.getObjectItem(execObj,"@V"); if (outValue) outValue->subtype =regType & 0xF; } + + aJsonObject *polledValue = aJson.getObjectItem(execObj,"@S"); + if (polledValue && outValue->type == aJson_Int) polledValue->valueint=Value; //to pevent suppressing to change back to previously polled value if this occurs before next polling + } } } diff --git a/lighthub/modules/out_pid.cpp b/lighthub/modules/out_pid.cpp index 0c4515f..7fdd512 100644 --- a/lighthub/modules/out_pid.cpp +++ b/lighthub/modules/out_pid.cpp @@ -213,16 +213,17 @@ int out_pid::getAlarmVal() aJsonObject * param; switch (aJson.getArraySize(kPIDObj)) { - case 7: //kP,kI,kD, alarmTO, alarmVal, outMin, outMax - case 6: //kP,kI,kD, alarmTO, alarmVal, outMin - case 5: //kP,kI,kD, alarmTO, alarmVal - param = aJson.getArrayItem(kPIDObj, 4); + case 8: //kP,kI,kD,dT, alarmTO, alarmVal, outMin, outMax + case 7: //kP,kI,kD,dT, alarmTO, alarmVal, outMin + case 6: //kP,kI,kD,dT,alarmTO, alarmVal + param = aJson.getArrayItem(kPIDObj, 5); alarmValDefined=true; if (param->type == aJson_Float) outAlarm=param->valuefloat; else if (param->type == aJson_Int) outAlarm=param->valueint; else alarmValDefined=false; - case 4: //kP,kI,kD, alarmTO + case 5: //kP,kI,kD,dT, alarmTO + case 4: //kP,kI,kD,dT case 3: //kP,kI,kD case 2: //kP,kI case 1: //kP @@ -234,7 +235,7 @@ int out_pid::getAlarmVal() { if (!alarmValDefined) outAlarm = 0.; } - else if (!alarmValDefined) outAlarm = .255; + else if (!alarmValDefined) outAlarm = 255.; } } return outAlarm;