AOI Sanity Check (overloading?)

JeremyM

Lifetime Supporting Member
Join Date
May 2014
Location
Dallas, Texas
Posts
1,233
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 think in most cases the units can be thought of more as a display feature than something integral to your computing. I would attempt to write my AOI in whatever "base" units I wanted to and then provide helper function to translate to whatever units are coming in or going out.

So you'd end up with a set of functions like F_TO_C(), C_TO_F(), PSI_TO_BAR(), etc...
If you are going to need to do the conversions anyway, might as well have them available to your whole program anyway and not be buried inside your AOI. Then your AOI would be much simpler as well.

Just my opinion (but at least it's free :) )
 
Last edited:

Similar Topics

Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
26
Views
564
I have a PH meter that I am trying to bring its data into 1756-L81. I have downloaded the Rockwell MODBUS AOI kit, but I am not sure if I need to...
Replies
5
Views
202
I am very new to Modbus and the industry, so forgive me if I am missing something obvious. I have known Modbus register addresses coming from a...
Replies
7
Views
251
Does anyone know of an AOI using the user ASCII protocol select on the L6x controllers that will talk Modbus RTU using RS-485? Thanks, Trevor...
Replies
1
Views
152
I have an AOI with revision notes. Someone entered the last note into the description instead of the notes. I cannot just click into the revision...
Replies
4
Views
161
Back
Top Bottom