^32 - The 1 °C Set Temperature Port
This port is a read only value of the set temperature in 1°C for the area the temperature sensor is assigned to. The subport returns the fractional set temperature in .01°C. These values are based on network messages and are not a measured values.
This port is similar to ^30, the 1/4 °C Set Temperature Port.
This is a read only value even though it doesn’t correlate to a physical component. |
Syntax
LDA ^32,0 //Returns the whole set temp
LDA ^32,1 //Returns the fractional set temp
Initial value is initial measured temperature until a set temp messages is received
Examples
Example 1
Example of a task checking the current measured temperature.
Task1()
{
LDA ^31,0 // Get the current temp in 1 degree C.
CMP ^32,0 // Compare to the set temp in 1 degree C.
BCC TooHot // If greater than or equal to the set temp it it too hot
BRC TooCold // If Less than the set temp it it too cold
Null
TooHot:
Dynet(0x6c,"TooHot")
Null
TooCold:
Dynet(0x6c,"ToCold")
Null
}
Example 2
Comparing vs set temp to add hysteresis
Task1()
{
Name="Heat Task"//This task keeps the current temperature within the deadband range of the set temp.
Fade=0
Area=HVACArea
HeatLoop:
LDA ^31,0 //Load the Actual Temperature
CMP ^32,0 //Compare to the target set temperature
BRZ CheckAgain //Are they the same? If so wait a bit and check again
BRC HeatUpCheck //Is the set temp higher than the actual temp? If not assume set temp is lower.
//////////////////Set Temp is Lower than Actual
LDA ^31,0 //Reload the Actual Temperature
Sub #Deadband //Subtract the deadband
CMP ^32,0 //Compare to the target set temperature to the modified actual temperature
BMI CheckAgain
//It is too hot, turn off the heater.
Preset(P=2) //Turn off HVAC but stay active.
BRA CheckAgain
Null
/////////////////Set Temp is Higher than Actual
HeatUpCheck:
LDA ^31,0 //Reload the Actual Temperature
Add #Deadband //Add the deadband
CMP ^32,0 //Compare to the target set temperature to the modified actual temperature
BPL CheckAgain
//It is too cold, turn on the heater
Preset(P=1) //Turn on HVAC but stay active.
////////////////Wait and check again
CheckAgain:
Delay(DelayTime) //Wait a bit so we don't run this check too quickly.
BRA HeatLoop
Null
}