obi1987 Member O Join Date Jan 2014 Location lahore Posts 114 Feb 7, 2014 #1 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?
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?
daba Lifetime Supporting Member D Join Date Jul 2004 Location uk Posts 5,401 Feb 7, 2014 #2 You didn't mention what your PLC make and model is. Without that information, it is hard to advise the best method.
You didn't mention what your PLC make and model is. Without that information, it is hard to advise the best method.
obi1987 Member OP O Join Date Jan 2014 Location lahore Posts 114 Feb 7, 2014 #3 I am using Compact logix and software is Rslogix5000
TConnolly Lifetime Supporting Member Join Date Apr 2005 Location Salt Lake City Posts 6,152 Feb 7, 2014 #4 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.
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.