
adccommunitymod (AutomationDirect) asked a question.
Created Date: July 29,2009
Created By: bmetdave
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I have a DL205 w/D2-260 CPU and three F2-08AD-1 modules that various 4-20mA sensors connected including 0-100psi pressure transmitters. I have everything scaled correctly and all my numbers are in BCD. I needed to set up alarm conditions for various pressure Delta P's. I can calculate the Delta P fine, the problem that I'm having is if pressure sensor "A " is 90psi and pressure sensor "B " is 91psi and my Delta P calculation is "A " - "B ", then Delta P is calculated to equal 9999 as opposed to -1 which triggers an alarm condition. How can I have my Delta P calculation and alarm condition ignore anything that is actually negative? Do I need to convert to something other than BCD before doing the Delta P calculation?
Created Date: July 29,2009
Created by: bfitz
Set up two different calculations and run them conditionally.
If A> B, A - B = delta
If B> A, B - A = delta
Delta can be the same register as only one equation should be operational at any given time.
Brian
Created Date: July 29,2009
Created by: bcarlton
You want an '= ' in one of those as I'm sure the delta will be zero at some time.
Created Date: July 29,2009
Created by: jwbaker3
Try, www.demarctech.com they have long and short range wireless units.
Created Date: July 29,2009
Created by: Do-more PE
If I understand correctly you want to have a negative BCD number???
Negative numbers cannot be expressed in BCD format. Here's why:
Let's take a single word of 9999 as the example. Where is the sign bit? It cannot be bit 15 as bit 15 is used to represent part of the 9 in the thousands place.
1001 1001 1001 1001
9 9 9 9
If the number is negative you need to be using a signed decimal (binary) or Real (Floating Point) format.
Created Date: July 29,2009
Created by: bcarlton
I understand the original poster to want the absolute value of the difference (in other words, he isn't worried at this point about which measurement is larger, just the actual amount (expressed as a positive number) of the difference). So the pre-test before subtraction should do what he wants.
Created Date: July 29,2009
Created by: bmetdave
That's correct. I do not want any negative numbers, just the difference between the two. My problem is since the numbers are in BCD, when the value of sensor "B " is subtracted from the value of sensor "A " and sensor "B's " value is larger, the calculated value becomes extremely large ie 94psi - 95psi = 9999psi instead of -1psi. My alarm conditions are true if the calculated value is greater than 10psi for example. In the above case, I get a false alarm because the the PLC calculates a Delta P of 9999psi when it is actually only a difference of 1 psi. I just need to watch for large pressure drops across several pre-treatment devices on our water system. Regardless of which of two sensors is highest, if the Delta P across any two sensors is greater than the pre-determined limits, I have a hardware problem that needs to be addressed. Thanks for the help. As usual, I was trying to make this harder than it needed to be.
Created Date: July 29,2009
Created by: bfitz
That's correct. I do not want any negative numbers, just the difference between the two. My problem is since the numbers are in BCD, when the value of sensor "B " is subtracted from the value of sensor "A " and sensor "B's " value is larger, the calculated value becomes extremely large ie 94psi - 95psi = 9999psi instead of -1psi. My alarm conditions are true if the calculated value is greater than 10psi for example. In the above case, I get a false alarm because the the PLC calculates a Delta P of 9999psi when it is actually only a difference of 1 psi. I just need to watch for large pressure drops across several pre-treatment devices on our water system. Regardless of which of two sensors is highest, if the Delta P across any two sensors is greater than the pre-determined limits, I have a hardware problem that needs to be addressed. Thanks for the help. As usual, I was trying to make this harder than it needed to be.
Actually, wouldn't it be helpful to care about which sensor is the highest? Assuming the water only flows one direction through a filter, if the pressure at the outlet of the filter is higher than the inlet, you have a sensor problem.
Brian
Created Date: July 29,2009
Created by: franji1
great application for the NOT contact (little known, little utlized)
This is a great application for the NOT contact (little known, little utlized)
STRGE A B
MATHBCD result "A - B "
NOT
MATHBCD result "B - A "
it's great for if/then/else logic like this one. Only one of the MATHBCD IBoxes will execute in a single scan, with just 1 comparison!
It looks like the following
A B +-----------+
--]>=
You can enter it using the Contact Browser. It looks like an invert gate (a triangle with a circle on the end)
Created Date: July 30,2009
Created by: bmetdave
Actually, wouldn't it be helpful to care about which sensor is the highest? Assuming the water only flows one direction through a filter, if the pressure at the outlet of the filter is higher than the inlet, you have a sensor problem.
Yes, that's correct. Every sensor has an alarm setpoint configured for that very purpose. Also, every pressure sensor and flow meter has a redundant analog gauge so that when a alarm condition is triggered, you can look at those gauges and quickly determine if it's a true pressure drop across a component or if a sensor is drifting out of range. However, if there's a better or simpler way to rule out bad sensor from true pressure drop alarm, I'm open to suggestions.
Dave
Created Date: July 30,2009
Created by: Tom Jenkins
We often do this kind of calculation. I find it very handy to have Bernie's comparisons turn on a coil (bit) to indicate "B is High " or "A is High ", and sometimes even "A=B " depending on the purpose. Then you can use the contact from that coil to enable or disable all kinds of logic, calculations, etc. This includes the two subtractions Bernie indicated. One place I find this useful is rate of change alarms.