SetOutputLimits(...)**************************************************** * This function will be used far more often than SetInputLimits. while * the input to the controller will generally be in the 0-1023 range (which is * the default already,) the output will be a little different. maybe they'll * be doing a time window and will need 0-8000 or something. or maybe they'll * want
| 152 | * here. |
| 153 | **************************************************************************/ |
| 154 | void PID::SetOutputLimits(double Min, double Max) |
| 155 | { |
| 156 | if(Min >= Max) return; |
| 157 | outMin = Min; |
| 158 | outMax = Max; |
| 159 | |
| 160 | if(inAuto) |
| 161 | { |
| 162 | if(*myOutput > outMax) *myOutput = outMax; |
| 163 | else if(*myOutput < outMin) *myOutput = outMin; |
| 164 | |
| 165 | if(outputSum > outMax) outputSum= outMax; |
| 166 | else if(outputSum < outMin) outputSum= outMin; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | /* SetMode(...)**************************************************************** |
| 171 | * Allows the controller Mode to be set to manual (0) or Automatic (non-zero) |
nothing calls this directly
no outgoing calls
no test coverage detected