Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/ConfigurationHandler/Controls/SetpointControl.cpp
- Revision:
- 92:9a6a1adca19c
- Parent:
- 91:0e8d76030598
- Child:
- 93:1553fb156915
--- a/src/ConfigurationHandler/Controls/SetpointControl.cpp Tue Sep 20 18:26:08 2016 +0000 +++ b/src/ConfigurationHandler/Controls/SetpointControl.cpp Tue Sep 20 19:19:34 2016 +0000 @@ -129,19 +129,19 @@ bool SetpointControl::overLimit(void) { ModbusValue value; + ModbusMasterReadRegister( input, &value ); + float flimit; - ModbusMasterReadRegister( input, &value ); - printf("overLimit: input=%s value=%2.2f, direction=%d\r\n", input, value.value, actingDir); - float high_band = setpoint + (setpoint * .04); - if( (value.value >= high_band && actingDir == true) || (value.value <= high_band && actingDir == false) ) { - printf("overLimit returning TRUE\r\n"); - // over limit - return true; + if ( !actingDir ) { + flimit = setpoint + (setpoint * .04); + return (value.value > flimit); + } else { + flimit = setpoint - (setpoint * .04); + return (value.value < flimit); } - printf("overLimit returning FALSE\r\n"); - return false; } + // Method: underLimit // Description: (see @return) // @@ -152,16 +152,16 @@ bool SetpointControl::underLimit(void) { ModbusValue value; + ModbusMasterReadRegister( input, &value ); + float flimit; - float low_band = setpoint - (setpoint *.04); - printf("underLimit: input=%s value=%2.2f, direction=%d\r\n", input, value.value, actingDir); - if( (value.value <= low_band && actingDir == true) || (value.value >= low_band && actingDir == false) ) { - // over limit - printf("underLimit returning TRUE\r\n"); - return true; + if ( !actingDir ) { + flimit = setpoint - (setpoint * .04); + return (value.value < flimit); + } else { + flimit = setpoint + (setpoint * .04); + return (value.value > flimit); } - printf("underLimit returning FALSE\r\n"); - return false; } // Method: startFeed()