I have 3 temeprature, where I need to know which is the highest. It should be moved to a register. How do I do it most easily. It should work both, when the temperature rises and falls
Rslogix 500
Make yourself the plc. In this case, how you would do it is the way you should tell the plc to do it.
Assume you are sitting at your desk. You can't remember ANYTHING for more than 1 second but you have a pencil and a pad of paper. Someone walks by your desk and and drops off three slips of paper, each with a number on it. You are allowed to look at each slips only once and you can't remember what they are once you look at them. How would you decide which is the highest?
Hojland:
Three temps, a,b and c.
For high temp: If a>b and a>c or b>a and b>c, or c>a and c>b. The one that is true must be save to a buffer.
The same analysis for low temp but <.
Then repeat same procedure every time you need it.
First, assume A is the "winner" value or "high score" register. I will call it H. (Let H=A).
Then compare the others to H one by one and MOVe any greater value into the "winning" register.