Variables which use the XPRESS Minute and Hour commands can sometime produce undesired results when displayed on the LCD-Link. For example, two variables which save the time a low temperature is recorded are set using the XPRESS code:
LowTempMin = Minute
LowTempHr = Hour
However, when these variables are displayed using the %Px
format descriptor, the leading zeros are not displayed. This makes
21:09 display as 21:9 . But using the %R descriptor adds too many
leading zeros.
Here is an XPRESS code example which produces a more normal looking hour and minute format:
LCD(0) = "\e[2;7H%R0 \e[2;4H%R0\x3A", LowTempMin,LowTempHr
LCD(0) = "\e[2;4H\x20 \e[2;5H\x20"
First the minutes are displayed then their leading zeros are overwritten
by the hour display followed by a colon (\x3A). The next line erases
out the hour's leading zeros with blanks (x\20). If text precedes the hour digits, it can also be used instead of blanks to cover the unwanted leading zeros.
|