TConnolly
Lifetime Supporting Member
Oops- should have been:
VarA>VarB or VarC or VarD
This should do the trick if he wants to know if VarA is larger than the other 3 tags i would think.
Be very careful with that one. It won't do a Boolean compare. It will bitwise OR VarB, VarC, and VarD into a single result and them compare if VarA is greater than that result. See AB knowledgebase technote 52939.
If Var B=5, Var B=4 and VarC=3 then they will be bitwise OR-ed and the result will be 7. If VarA=6 then the test will fail. VarA is greater than all the others, but it is not greater than the bitwise OR-ed result of 7, so the comparison will be incorrect.
It is better to use three comparisons in series. This way you are sure of exactly what you are instructing the processor to do. Ambiguity in software is not worth it when expensive processes, safety, plant uptime, and 3:00 am phone calls from Bubba are on the line.
Last edited: