DL05 Math Question

PumpMD

Member
Join Date
Apr 2013
Location
Maine
Posts
4
I am a newby at programming but I have been able to get my analog inputs to display back to the operator interface.
My question is......I have two analog input values and when the difference between the two arrives at a certain value I would like to have an output close. I can't seen to find a math equation that gives (if greater than ___ then ___)
I may not be explaining this well but hope someone else has an idea.
Thanks
 
Are the values in BCD or Binary?

Is one of the values always greater than the other?

Do you want to trigger when the difference is exactly at a certain value or some other relationship?
 
I can't seen to find a math equation that gives (if greater than ___ then ___)
You could use the "load and compare" method. The CMP (compare instruction) uses 3 special-purpose status flags SP60 (less than), SP61 (equal), and SP62 (greater than). The SP relay bits must be examined directly after the Load and Compare.

DL-05 Analog Load & Compare.jpg
 
First of all, the analog values will have to be exact to perform what you want. If they are, then a Ld K???, analog value, then OUT v???, same values, then Y???, which is an output address, should turn the output on. Lancie, you are too anal, lol. Inputs are first.
 
First of all, the analog values will have to be exact to perform what you want.
NO! It is the DIFFERENCE between two analog inputs that PumpMD wants to compare with some set value.

Lancie, you are too anal, lol. Inputs are first.
What I posted was an existing example of a comparsion of an ANALOG INPUT to a fixed value. For PumpMD's case, first subtract Analog 2 from Analog 1, CMP the difference to a constant V-memory set value, then look at SP60. When the differene between the analog inputs is less than your V-memory value, SP60 can be used to turn on an output. Do not use SP60 to HOLD an output on, or to turn it off, because a following rung could use SP60 for something else.
 
Last edited:
OK, but what he is saying, is that when the 2 inputs reach agreement, the output should come on. No? Lets all agree to disagree here

 
Are the values in BCD or Binary?

Is one of the values always greater than the other?

Do you want to trigger when the difference is exactly at a certain value or some other relationship?
Bernie, The values are always with one always higher than another and they are in BCD.
I do want to establish a preset value for a trigger if the differential gets higher than a preset value.
What we are doing is monitoring the pressure drop across a filter and we want to alarm when the drop gets too high.
 
I think that Lancie has about the right plan. Not exactly sure how to leg it out but I will give it a try. Thanks
 
OK, but what he is saying, is that when the 2 inputs reach agreement, the output should come on. No?
No was correct.

It helps to carefully re-read the question and look for those descriptive terms such as "...the difference between the two...". You have to be a word detective. You get that way after many years sweating over bid proposals from prospective customers.
 
Bernie,
That looks perfect, Thanks.
Looking forward to getting a chance to try it out.
You've been a big help!!
 

Similar Topics

I've written a large program(300 rungs so far) and I am running into a problem with binary math. According to the DL05 manual DIVB and MULB says...
Replies
13
Views
3,468
I have an HMI device that allows more numbers or less than the limits I provide, For example, V2000 is the HMI input and on this HMI you can go...
Replies
7
Views
2,083
need to find C bits in the logic. They are hidden someplace! Thank you! Bob
Replies
5
Views
195
I have a c-more micro with a three digit input box on one of the screens. This is being written to a memory location in a DL05. I don't have the...
Replies
3
Views
109
Does anyone have example code of how to read/write a discrete push button from a C-More Micro to a DL05. I just bought these two items and I am...
Replies
2
Views
982
Back
Top Bottom