Masks

CCatterton

Member
Join Date
Oct 2006
Location
Indiana
Posts
13
Can some one help me understand masks. I have been using PLC's for about 4 years, but I have never learned or used masks. Any and all help will be appreciated.

Thanks,
Clayton
 
Greetings Clayton ...

try reading the three posts which start here ... if that doesn't answer all of your questions, please let me know and I'll try again ...

incidentally, the forum was changed a few years ago ... the "attachments" are all still there - but they've just been relocated to the end of each post ...

and welcome to the forum ...
 
Last edited:
a mask is used to block out bits of info
in the mask were you have a 0 it blockes that bit were there is a 1 it lets the bit pass though
here are some examples


Input========00101100
mask========00001100
what you get==00001100

Input========00101100
mask========00100100
what you get==00100100

this is a down and dirty explanation i am sure there will be some one with a better one
 
Last edited:
Bob,

Thanks for the prompt reply. The archived post you sent me to was great, and very informative. I now understand them.

Thanks,
Clayton
 
Commonly used to separate digits/bytes out of a word.

Function ANDW D2000 #FF00 D2002 will mask one byte and allow the other through. I commonly use it to separate hour/day in the PLC timeclocks when hour/day are held in the same word but in separate bytes.

Some PLCs have NOR, XOR functions etc that can be used as a mask for bits.
 
CCatterton said:
Bob,

Thanks for the prompt reply. The archived post you sent me to was great, and very informative. I now understand them.

Thanks,
Clayton
Opps...sorry ron...that was supposed to be you, not bob

Sorry!

Clayton
 

Similar Topics

Hi. My understanding of a class C address for example 192.168.210.10 was that it could only communicate with devices on the 192.168.210.X range...
Replies
15
Views
7,583
Back
Top Bottom