From the course: Learning PLC Ladder Logic: 2 Diving Deeper

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Mask parameter

Mask parameter - Ladder Logic Tutorial

From the course: Learning PLC Ladder Logic: 2 Diving Deeper

Start my 1-month free trial

Mask parameter

- [Instructor] In the mask parameter, we put the value that is used to mask, or filter, the source data. The mask is a hexadecimal value. Mask bits can be either a constant or the address where the mask will be found. Data is passed through the mask bit by bit. The mask bit in the same position as the source bit determines if the data is to pass or not. To pass data through the mask, we set the bit to be equal to one in order to make the data pass through. To mask data from passing from the source to the destination, we set the bit to be equal to zero. So here's how it works. If the source data is this 16 bit word binary number and the mask is this 16 bit word binary number, now the values that are going to be moved to the destination are the ones with one. Remember, to pass data is to make the mask one and to block the passing is to make it equal to zero. So the first eight bits of this 16 bit word source will only…

Contents