min and max values in V-memories using DL205...How???

MannyCasanova

Member
Join Date
Jul 2010
Location
Oceanside, CA
Posts
2
I am almost finished with this project but now Im kind of having a hard time trying to figure out how to find the maximum and minimum values from 15 DoubleWord V-memory locations. Actually I need the V-memory with the lowest value. Just cant figure this one out. Any ideas.
Using DL205 with 250-1 Processor.
 
If all else fails, here's the brute force method, assuming BCD:

Rung 1 - Move 99999999 to "Lowest_Value"
Rung 2 - If 1st Location < "Lowest_Value", Copy 1st Location to "Lowest_Value"
Rung 3 - If 2nd Location < "Lowest_Value", Copy 2nd Location to "Lowest_Value"
.
.
.
Rung 16 - If 15th Location < "Lowest_Value", Copy 15th Location to "Lowest_Value"
 
Actually I need the V-memory with the lowest value
the min. of the 15 v memory locations or the min. of the samples of each v memory location?
also it could be a help to post your logic
best regards, steve
 
The V-memory with the lowest value of the values in all the V-memory locations. For example:
V6200-V6201: 22.5
V6202-V6203: 24.8
V6204-V6205: 28.0
V6206-V6207: 21.5

Here from these four V-memory locations, I would like to know that V6206(DWORD-Double)has the lowest value in it from the V-memories listed.
And that V6204(DWORD) has the highest value.

I would post my code but I have none regarding this yet. I am now trying the brute force mentioned above.
I wish their was a better way, using IBox or something.
 
We always use pointers to process these types of lookups. MIN and MAX are fairly easy. In our programs the location or index of the MIN or MAX can be important so we record that for each compare which triggers a new save.

Our trickiest is to find the CLOSEST match from a table of 50 values. This requires use an absolute value. There are many ways of doing this. Pointers make things a lot easier.

Steve gave you the 'brute force' method.

[Edit - We do a LOT of table lookups. I can be of help if you are more specific. Are these values pre-entered? - in which case you obviously know the MIN and MAX. If they are being accumulated over time then a simple record of MIN and MAX can be made at each entry.]
 
Last edited:

Similar Topics

Hope everyone is refreshed and ready to get back at it after new year! I'm struggling to find where or if i can set the min and max values of a...
Replies
1
Views
1,117
I'm really trying to test the limits of what SE can do with E-sig buttons for a customer. They want all the existing buttons converted to E-sig...
Replies
1
Views
1,771
Looking at 6 Integer values...say N7:0 - N7:5. Need a clever way to find the Minimum and Maximum values from this group. Better yet would like to...
Replies
5
Views
6,326
I am programming a PLC5 and have come across a problem that the customer has requested. The customer requires me to monitor a thermocouple value...
Replies
3
Views
4,545
Hi there. I have to calculate the mean, max and min value of about 600 values in types REAL. Is there any standard blocks to do this in an easy...
Replies
1
Views
4,485
Back
Top Bottom