More help with a BSL instruction

rangell

Member
Join Date
Aug 2006
Location
Limerick, Pa
Posts
25
Ok, I got my BSL instruction doing what I want it to do, kinda. I am using it in a ML1000, in the instruction set reference manual it says "If you alter the length value with your ladder program, make certain that the altered value is valid". Well, that's what I want to do, is change the length value by using different inputs. The book does not give an example of how to do this. Let's say if input I;0/0 comes on, I want to load 1037 into the length. and if I;0/1 comes on I want to load 789 into the length. Anyone have an example or suggestion of where to look it up? I looked on the AB knowledgebase---not much help there. Thanks in advance.
 
As long as both of those values will generate a valid length in your addressing of bits, it will work.


The warning would apply if you were to change the length to a value that would exceed the length of the bit file.

Just use a MOV with the values you need. Move 789 or 1037 into the control word.LEN register.
 
If I remember your program, you are using the BSL Unload bit (R6:0/UL) to trigger the Defect Latch. There are two alternatives that might keep you from having to switch the length of the BSL on the fly.

You can set the BSL Length for your largest value (longest conveyor run). Then instead of using the R6:0/UL bit, you use a N7:?/? bit to trigger the Defect Latch or other actions.

WHICH N7 bit you use depends on the distance from your I:0/0 Length Detector to the point where you want to perform an action.

Use the N7:64/13 bit for the 1037 length (1037/16 = 64 with 13 remainder) and another (shorter) bit N7:49/5 (789/16=49 with 5 remainder) for the "789" action.

You said you are using I:0/0 and I:0/1 to determine which Length to use. I think I:0/0 (from your previous post) is also your encoder tubing length input. I:0/1 is an input from what? If it is another encoder, then it might be wise to set up a separate BSL for it.

Otherwise, use the above method, and add logic so that N7:49/5 is only triggered when I:0/1 is on, and N7:64/13 is only triggered when I:0/0 is on.

Another way is to switch to a BSR shift register, which shifts right, in the opposite direction from the BSL, so that instead of your I:0/0 bit being introduced at N7:0/0, it is put in at the high end of the Length array, and the array shifts down to N7:0/0 from there. This is sometimes easier to visualize and easier to change if sensors or gates are sometimes moved.
 
Last edited:
Lancie1,

Yes, you are correct about the input addresses, I was just using those addresses as an example for this post.

So, if I understand correctly, you are saying to use the N7 file as the control? Forgive me, I'm not real good with the "higher level" programming, not to bad with plain old ladder logic!

Do you know of anything or any place on the internet that really goes into depth on explaining some of these "special function" boxes? Kinda like PLC's for dummies.
 
No, I think what Lancie was saying, is keep the length set for the longer of the two, and just examine whichever position within the file you need based on the other conditions. (I have not seen your other post.)

So, use B3/1037 or B3/789 depending on which length you need to reference for the two different conditions.

Lancie used N files and broke it down into word/bit addressing for you.
 
No, do not use N7 for the Control in the BSL Instruction. Keep the R6:0 as the "Control". I am simply saying that are not forced to only use the R6:0/UL to trigger some action. The BSL shift register is continuous from the beginning (first bit in the "File" address) up to the last bit in "File". You can use any bit in that range to control some action. R6:0/UL, the "Unload" is simply a copy (in your case) of N7:64/13, the last bit in the "File" address. This is the bit that gets overwritten by the next one to the right (N7:64/12) as N7:64/12 is overwritten by N7:64/11, and so on all the way back, for a Length of 1037, to N7:0/0, where a new bit from your "Bit Address" is introduced EACH time the BSL is energized and shifted.

The best description of BSL is in the RSLogix Help file, under "SLC Instructions". Read and study it carefully, think about what a Shift Register is doing (simulating the movement of real objects from one point to another by moving bits from one location to another). Once you understand the basic function of Shift Registers, you will then be able to see that as an object moves down a line for "X" distance, a bit moves the same scaled distance in the shift register. You can pull that bit out at any point (any distance from Start, not just at R6:0/UL, the end of the line) and use it for whatever desired purpose.

Because you can pull out a BSL from the File addresses at any length from the beginning, then I am simply saying that you do not necessarily have to change the Length parameter of the BSL to look at other lengths. Simply set Length for the longest possible run, then pull out the appropriate N7:Word/Bit at the desired "length" from N7:0/0.

Of course if your preferred method is to swap the Length parameter, then do it that way. You get to choose, depending on which way you think will work best.

Exactly right, Paul. Perhaps the conversion to Words and Bits is confusing. I always think in terms of Words and Bits, but if it is easier then use B3/1037 and B3/789 (bit position only, but you would have to convert to use N7 addresses in many RSLogix instructions that do not allow the File/Bit addressing method).

It helped me when I was first learning about Shift Registers, to set one up in N7 and then watch the bits (in Data File) march across the screen from start to the end of the Length parameter, as the real object moved down the conveyor.

If you open your "ZUMBACH STD DAVIS.RSs" program, then go to Data Files in in left tree menu, then click "N7-INTEGER", then click "Usage", you will see X's in all the words that are being used in your BSL shift register (N7:0 up to N7:64). Note that although your shift register ends at N7:64/13, the remaining 2 bits in that word cannot be used for anything else.
 
Last edited:
Thanks, Lancie1 and Okiepc,


Now I'm understanding a little better, Lancie1's explaination cleared it up a little more. I will do so experimenting today and try to figure this out. Fortunatly I have a unit I can "play with" at my desk. Thanks for all the help guys.
 

Similar Topics

Hello everyone, I have learned a lot about incremental encoders today. But I am down to one last issue and it's a big one. I have 8 incremental...
Replies
9
Views
1,745
I've downloaded my cmore and clx projects to their respective devices and have established communication and control. One of the screens co2 has...
Replies
6
Views
3,049
Hi, i uploaded program from Allen Bradley PLC, i need someone to help me elaborate more on this uploaded project will appreciate any help thanks
Replies
6
Views
2,114
So far so good, Almost done with this migration stuff Someone please help me on this one: ERROR IS: ''Bit and LSBit triggered alarms that used...
Replies
2
Views
1,666
I'm using a Do-More and a Leuze Electronic ODSL 9 sensor to monitor a large hydraulic cylinder. I have to calculate and log the velocity. I...
Replies
1
Views
1,344
Back
Top Bottom