JeremyM
Lifetime Supporting Member
Hi all,
I've written a subroutine to compute the relative humidity for a process we're running in RS5K. I like it and think it's better to implement as an AOI. Needless to say, there are many possible units of measure for the three passed variables in use - wet bulb temperature, dry bulb temperature, and atmosphere pressure.
Instead of writing the AOI that many times over, I am toying with passing an integral value that indicates what the units actually are, then handling these cases internally. Bit 0 indicates a whether the wet bulb temperature is in F or C, Bit 1 indicates the dry bulb unit, and so on. Complicating this, there's also K to measure temperature with. Atmospheric pressure could be Pa, kPa, mmHG, inHG, or PSI and so on. Should I go all-inclusive or should I stick with a standard set of units only?
I think this is an interesting question of functional ownership - should an RH function do conversions at all or assume the calling code has been correctly written? What are your thoughts?
I've written a subroutine to compute the relative humidity for a process we're running in RS5K. I like it and think it's better to implement as an AOI. Needless to say, there are many possible units of measure for the three passed variables in use - wet bulb temperature, dry bulb temperature, and atmosphere pressure.
Instead of writing the AOI that many times over, I am toying with passing an integral value that indicates what the units actually are, then handling these cases internally. Bit 0 indicates a whether the wet bulb temperature is in F or C, Bit 1 indicates the dry bulb unit, and so on. Complicating this, there's also K to measure temperature with. Atmospheric pressure could be Pa, kPa, mmHG, inHG, or PSI and so on. Should I go all-inclusive or should I stick with a standard set of units only?
I think this is an interesting question of functional ownership - should an RH function do conversions at all or assume the calling code has been correctly written? What are your thoughts?