Grendizer said:
...I have a table like the following example:
B21:0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
B21:1 0 0 0 0 0 1 0 0 0 0 0 0 0 0
How can I clear the orange highlighted eleI have a table like the following example:
B21:0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
B21:1 0 0 0 0 0 1 0 0 0 0 0 0 0 0
How can I clear the orange highlighted elements in a small a nice programming way?...
Please note that in RSLogix Land an "element" refers to a whole 16-bit word and is not used to denote a single bit, or bits within a 16-bit word. If that is what you meant.
So...
B21:0
Is element, or word 0 in the Binary Data File B21
Word 0 contains 16 individual bits
B21:1
Is element, or word 1 in the Binary Data File B21
Word 1 also contains 16 individual bits
Why am I pointing out the seemingly obvious?
Because in your example...
B21:
0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
B21:
1 0 0 0 0 0 1 0 0 0 0 0 0 0 0
...you "appear" to be mistakenly trying to use the element or word pointer as one of the bits of the word. Even still, your example has fallen short. If we separate the word pointer out you only have 14 bits accounted for. There should be, of course, 16 bits...
WORD---
14 bits instead of 16 bits
B21:0---
0 0 0 0 0 1 0 0 0 1 0 0 0 0
B21:1---
0 0 0 0 0 1 0 0 0 0 0 0 0 0
So instead you should have...
WORD---
16 bits instead of 14 bits
B21:0---
0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0
B21:1---
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
Now I know it was just an example and I was sure that it was most likely just a typo error and that most to all people reading just focused on the solution, whether contributing or learning, and that solution is perfectly fine.
I could and would have probably let it slide if I had not then read your later post...
Grendizer said:
So in:
B21:0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
B21:1 0 0 0 0 0 1 0 0 0 0 0 0 0 0
I would say:
source 0
Mask 11111111111111000
Dest B21:0...
...in which you then went on to specify a Mask value containing 17 bits, which, of course, should only contain 16 bits. Again, maybe just another typo error made in haste?
Either way, I wanted to point out these small but important errors to you just in case you have or had any fundamental misconceptions with regard to the correct structure and terminology of the RSLogix 500 addressing syntax.
If you don't, and your just a hasty typer, then slow down, a little, and double-check your posts before clicking that submit button!
You never know when I'll be watching!
Regards,
George