RSLogix Bit Shift Left Question

jthornton

Member
Join Date
Jul 2002
Location
Poplar Bluff, MO
Posts
295
Can someone clarify the BSL instruction for me?

Length is that in bits or words?
If length is in bits why select any number below 16 as the instructions say that Bits located to the left of the last bit in the array, up to the next word boundary cannot be used.

Maybe I'm just looking at the wrong instruction....
I have 5 stations when the indexer cycles all stations move one step.

1 > 2, 2 > 3, 3 > 4, 4 > 5, 5 out

This leaves Station 1 empty until it is filled by the operator.

I want to track the status of each station each time I cycle the indexer. If I don't have to use a whole word to do this it will be better as I am using a L511 1k memory processor.
 
Hi,

You can use less than 16 and start at any bit,but be careful with indirect addressing as this will fault the proccessor.
 
According to the help file

"File is the address of the bit array you want to shift. You must use the file indicator (#) in the bit array address. You must start the array at a 16-bit element boundary, for example, use bit 0 of element #1, 2, 3, etc."

How is it possible to start at any bit?

Thanks for your reply

John
 
File

The address of the bit array to be shifted. The initial bit number in an array must correspond with an initial bit in a word (0, 16, 32, and so on.)

© 1997 Rockwell Software Inc.

I do apologise i got mixed up with a BTD.

You are right the array must start at bit 0 of any word.
(see above)
 
It may be as few bits as you want, so, if the file bit is #b10:0 (you must use the #), and the length is 5, the value pushed from b3:10/4 is the value of the .ul bit.

However, the instruction only shifts on the word level, so the bits in the entire b10:0 shift all the way to b10:0/15 after the .ul is dealt with. Even though the instruction shifts through the whole word, it ignores the value of bits 5-15. But this phenomenon prevents you from using 5-15 elsewhere in your code, as they WILL be manipulated by the BSL.

The same holds true if the length were 25--you must not use the last 7 bits of the second word elsewhere--the instruction shifts the remaining bits of the highest word included in the file.

The best thing to do is create a b file for each BSL in the program.

This is just nice to know stuff--I learned the hard way.
 
Now I'm confused again...

The EN and DN seem to both be on and off at the same time. Is there one scan difference between the two? In other words does the EN come on when a false-to-true transition happens and the DN come on one scan later even if it is still true? If that is the case in what way would you use the EN and DN bits?


Thanks
John
 
Your right, the EN and DN bits do come on at the same time. I checked using RSEMULATE 500. When the rung is true, EN bit comes on, bit is shifted, DN bit comes on and then next rung is executed. According to SLC 500 Instruction Set manual:

"Using BSL
When the rung goes from false-to-true, the processor sets the enable bit (EN bit 15) and the data block is shifted to the left (to a higher bit number) one bit position. The specified bit at the bit address is shifted into the first bit position. The last bit is shifted out of the array and stored in the unload bit (UL bit 10). The shift is completed
immediately.

For wraparound operation, set the position of the bit address to the last bit of the array or to the UL bit, whichever applies."

This has a good description of how it works.

http://www.ab.com/manuals/cp/1747-rm001c-en-p.pdf
 

Similar Topics

Good morning (EST), I am trying to implement the code below in on an S7-1200. It's barely half a dozen instructions, but I am stuck; I have not...
Replies
26
Views
5,525
I have been trying to figure out the BSL instruction in Logix 500 V6.20 for a while and I just have'nt been able to get it. I would like to shift...
Replies
5
Views
6,890
Hello, Haven't been on in a while. I need to generate a bit level pdf of the I/O for RSLogix 500. I can generate a report but it just shows the...
Replies
1
Views
112
Hi, I'm just looking for a simple way to make a button in excel (via VBA I presume) to toggle a bit in RSLogix 5000. I just got FactoyTalkLinx...
Replies
9
Views
488
If any of you wizards can help in this I would be ever more grateful. We have this device that generates 9 second pulses coming into a DI module...
Replies
31
Views
3,457
Back
Top Bottom