RSLogix500 - How To Clear Binary Table?

Grendizer

Member
Join Date
Apr 2012
Location
Toronto
Posts
88
Hey All,

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 elements in a small a nice programming way?

I have floats and integers also. I used FLL with no problem. But I don't know how to do it for the binary type.

Thanks,
 
Do they change? (the orange) if they are static you can write a 0 when you need to clear them, you can do this with a MOV or a MVM

In the help file look up MVM
 
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

Ye? But the ****ty part is that I need 1 MVM for every word?

 
But the ****ty part is that I need 1 MVM for every word?
You can look at it that way. Or, one could say that having a powerful instruction like this is a tremendous help. To a great extent this is a function of the fact that you have a different mask for each word.

If there's a ton of (contiguous) words you need to operate on you could set up a loop and use indirect or indexed addressing to do the masking.
 
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
 

Similar Topics

Hey all, I have: 30 Float Data File each containing 256 elements. I want to clear the values of all the 30 Data Files, how can I accomplish this...
Replies
8
Views
2,561
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
15
Views
309
So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one...
Replies
6
Views
562
Hello, I'm new to programming. I'm using RSLogix500 to modify an existing program for a SLC500. My plan was to use one of the existing inputs...
Replies
26
Views
2,055
So i have an allen bradley rack (2080-LC50-24QWB), i have it connected through ethernet. I dont have an offline program so im trying to upload...
Replies
6
Views
721
Back
Top Bottom