Find Maximum/Minimum Integer

obi1987

Member
Join Date
Jan 2014
Location
lahore
Posts
114
I assigned different values to pump(1,2,3) and these numbers I assigned to pump is status of pumps.Now i want to do which comes in first will first off.So how i can find the Maximum and Minimum of Pump states?
 
You didn't mention what your PLC make and model is.

Without that information, it is hard to advise the best method.
 
Max := Pump1
If Pump2 > Max then Max:= Pump2
If Pump3 > Max then Max:= Pump3.

Do the same for minimum.

For large quantities in an integer array you can use a SORT. Then the min and max are at each end of the array.
 

Similar Topics

Hi all, I'm not too familiar with SCL programming and I need some guidance on writing a simple code in SCL that scans through a given number...
Replies
9
Views
4,749
Hi All i have a trouble find Maximum of 30 Temp Transmitters can any one help me out with this?? So that we can use the maximum value and use it...
Replies
12
Views
3,650
Hi All, Wondering if anyone has a source for information about products with problematic production runs from allen bradley/rockwell. Ive seen...
Replies
2
Views
129
Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
163
I have tested every screen and no single screen individually has this fault pop up, but when I compile and send to the PanelView it comes up. If I...
Replies
4
Views
194
Back
Top Bottom