Section 15.4.14.1 · Chapter 15: Using Macros
Calculating Relative Humidity
The following four calculations can be done by macro command SYS with service code 31:
1. Calculates the relative humidity with given temperatures of dry bulb and dew point.
2. Calculates the relative humidity with given temperatures of dry bulb and wet bulb.
3. Calculates the dew point temperature with given relative humidity and dry bulb temperature.
4. Calculates the wet bulb temperature with given relative humidity and dry bulb temperature.
All the calculations are based on the vapor pressure formula published by Hyland and Wexler.
1. To calculate the relative humidity with given temperatures of dry bulb and dew point, use one of the following macro commands.
SYS(31, 1, P3) or SYS(31,2,P3)
Parameters:
| P1 (I/C) | The system service code. It must be 31. | |
| P2 (I/C) | The operation code | |
| Operation Code | Description | |
|---|---|---|
| 1 | For the temperatures in Celsius | |
| 2 | For the temperatures in Fahrenheit | |
| P3 (I) | The memory block that stores the given temperatures and the result. The temperatures and the result are all 32-bit floating point numbers. The memory block hence requires 6 words. The following is the memory arrangement of the memory block. | |
| Word No. | Description | |
| 0,1 | The given dry bulb temperature | |
| 2,3 | The dew point temperature | |
| 4,5 | The calculated relative humidity. Note: The value is 0 if the calculation failed. | |
| Example |
$U200 =
70 (F)
// Set the dry bulb temperature in
Celsius
$U202 = 65 (F) // Set the dew point temperature in Celsius SYS(31,1,$U200) // Calculate the relative humidity // The result is saved in $U204 and $U205 and should be 80.2547 |
|
2. To calculate the relative humidity with given temperatures of dry bulb and wet bulb, use one of the following macro commands.
SYS(31, 3, P3) or SYS(31,4,P3)
Parameters:
| P1 (I/C) | The system service code. It must be 31. | |
| P2 (I/C) | The operation code | |
| Operation Code | Description | |
|---|---|---|
| 3 | For the temperatures in Celsius | |
| 4 | For the temperatures in Fahrenheit | |
| P3 (I) | The memory block that stores the given temperatures and the result. The temperatures and the result are all 32-bit floating point numbers. The memory block hence requires 6 words. The following is the memory arrangement of the memory block. | |
| Word No. | Description | |
| 0,1 | The given dry bulb temperature | |
| 2,3 | The wet bulb temperature | |
| 4,5 | The calculated relative humidity. Note: The value is 0 if the calculation failed. | |
| Example |
$U500 =
60 (F)
// Set the dry bulb temperature in
Celsius
$U502 = 29 (F) // Set the wet bulb temperature in Celsius SYS(31,3,$U500) // Calculate the relative humidity // The result is saved in $U504 and $U505 and should be 9.4905 |
|
3. To calculate the dew point temperature with given relative humidity and dry bulb temperature, use one of the following macro commands.
SYS(31, 5, P3) or SYS(31,6,P3)
Parameters:
| P1 (I/C) | The system service code. It must be 31. | |
| P2 (I/C) | The operation code | |
| Operation Code | Description | |
|---|---|---|
| 5 | For the temperatures in Celsius | |
| 6 | For the temperatures in Fahrenheit | |
| P3 (I) | The memory block that stores the given values and the result. The values and the result are all 32-bit floating point numbers. The memory block hence requires 6 words. The following is the memory arrangement of the memory block. | |
| Word No. | Description | |
| 0,1 | The given relative humidity | |
| 2,3 | The given dry bulb temperature | |
| 4,5 | The calculated dew point temperature. Note: The value is -99990 if the calculation failed. | |
| Example |
$U300 =
80.2547 (F)
// Set the relative
humidity $U302 = 70 (F) // Set the dry bulb temperature in Celsius SYS(31,5,$U300) // Calculate the dew point temperature // The result is saved in $U304 and $U305 and should be 65 |
|
4. To calculate the wet bulb temperature with given relative humidity and dry bulb temperature, use one of the following macro commands.
SYS(31, 7, P3) or SYS(31,8,P3)
Parameters:
| P1 (I/C) | The system service code. It must be 31. | |
| P2 (I/C) | The operation code | |
| Operation Code | Description | |
|---|---|---|
| 7 | For the temperatures in Celsius | |
| 8 | For the temperatures in Fahrenheit | |
| P3 (I) | The memory block that stores the given values and the result. The values and the result are all 32-bit floating point numbers. The memory block hence requires 6 words. The following is the memory arrangement of the memory block. | |
| Word No. | Description | |
| 0,1 | The given relative humidity | |
| 2,3 | The given dry bulb temperature | |
| 4,5 | The calculated wet bulb temperature. Note: The value is -99990 if the calculation failed. | |
| Example |
$U600 =
9.4905 (F)
// Set the relative
humidity $U602 = 60 (F) // Set the dry bulb temperature in Celsius SYS(31,7,$U600) // Calculate the wet bulb temperature // The result is saved in $U604 and $U605 and should be 29 |
|
Need PM Designer itself?
V4 for current PK, PT, ITV and PM panels, V2 for older models. Free, sent by email.
Source.Section 15.4.14.1 of the PM Designer Software User Manual, Edition 2.0, © Cermate Technologies Inc. (www.cermate.com, service@cermate.com). Reproduced online, with the manual's own figures, by TSL Automation Solutions, authorised Cermate distributor, for users of Cermate HMI panels. PM Designer and PanelMaster are trademarks of Cermate Technologies Inc.
Text and figures are the manufacturer's and may describe features your panel or software version does not have. For a plain-language introduction read the PM Designer guide; for help with a specific panel contact TSL Automation.