Bit masking tutorial using EQU instead of MEQ

Hey there,
I was going through the MEQ tutorials and wanted to ask if EQU should be used instead of MEQ if you wanted to verify that the ingredient valves NOT called for by the recipe remain closed?

Thanks for the help.

You can use either instruction depending on the case. The EQU will just compare two integers bit by bit and return true if they’re equal and false if they’re not. The MEQ will do the same except only with the bits that are affected by the mask. In other words, if the entire mask is blank, the MEQ is equivalent to the EQU. The advantage of the MEQ is that you can dynamically change the mask based on PLC code. If it’s always going to be the same, you can just use the EQU.