PLC Programming Structure Question

Kevin,

It is the address of the bit that is going to be inserted into the bit-shift register (memory storage array) for each and every time the rung logic for the BSR goes true.

BSR [Bit Shift Right]
Rockwell Software 2000
Use with processorsAll SLC and MicroLogix processors Example of Instruction(Parameters shown are examples only, your data will vary.)

Description
On each false-to-true transition, this output instruction loads a bit of data into a bit array, shifts the pattern of data through the array to the right, and unloads the end bit of data.
An example of the use of this instruction might be for tracking bottles through a bottling line where each bit represents a bottle.

Entering Parameters
Depending on the type of processor you are using you may use indexed or indirect addressing to represent addresses in this instruction.

To program a BSR instruction enter the following parameters:

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.

Control is the unique address of the control structure (48 bits, 3 16-bit words) in the control area of memory that stores the instruction’s status bits, the size of the array (in number of bits), and the bit pointer (currently not used).

The control element:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 0 EN DN ER UL Not Used
Word 1 Size of bit array (number of bits)
Word 2 Bit Pointer (currently not used)

Warning! Do not use the same control address for more than one instruction. Duplication of these addresses could result in unpredictable operation, possibly causing equipment damage and/or injury to personnel.

Bit Address is the location of the bit which will be added to the array.

Length is the total number of bits to be shifted by the BSR. Bits located to the right of the last bit in the array, up to the next word boundary cannot be used.

Control Word Status Bits
10 = UL (unload) bit
11 = ER (error) bit
13 = DN (done) bit
15 = EN (enable) bit

Note The shift operation clears the index register to zero. Make sure to load the correct offset value back to S:24 after shift execution if you use indexed addressing in your program.
Rockwell Software 2000
 
Sorry ive been busy with band practice and christmas stuff. I got a bit of time to test out the bit shift stuff, It seems to work well Im going to order some more parts I need and finish the build.

Kevin
 
That's great news! Did you see what I was trying to do with the 5 BSRs: simulate the movement of the game "note conveyor" inside the PLC memory. It turned out that the BSR length needs to be 2 instead of 1. That is because the last rightmost position on a BSR is the output position, so you don't want the shifted bit to appear there until it is time to play the note.

So you have to back up another position and insert the incoming notes at the second bit. The insertion positon address is determined by the 1st bit of the BSR "File" address + the BSR bit "Length". For example, if the File address is #B3:1, then the BSR Output is going to be at bit B3:1/0, and if the Length is 2 (meaning that the bit-shift register is 2 bits in total width), the insertion position will be the 2nd bit left from B3:1/0, or B3:1/1. So your Input to be shifted will be put into the BSR "Bit" address and it will immediately appear at B3:1/1 when the BSR is shifted by making the rung logic go true. For a BSR, unlike the BSL, the bit insertion address never actually appears in the instruction or in the program.

To make the BSR shift (move) at the same rate as an external moving object, the input that enables the BSR must be triggered by the movement of an object over some distance or during some time period. To make a bit-shift register work correctly, you have to have an input (or a combination of inputs) that indicates proportional movement in the external world.
 
Last edited:
That's great news! Did you see what I was trying to do with the 5 BSRs: simulate the movement of the game "note conveyor" inside the PLC memory. It turned out that the BSR length needs to be 2 instead of 1. That is because the last rightmost position on a BSR is the output position, so you don't want the shifted bit to appear there until it is time to play the note.

So you have to back up another position and insert the incoming notes at the second bit. The insertion positon address is determined by the 1st bit of the BSR "File" address + the BSR bit "Length". For example, if the File address is #B3:1, then the BSR Output is going to be at bit B3:1/0, and if the Length is 2 (meaning that the bit-shift register is 2 bits in total width), the insertion position will be the 2nd bit left from B3:1/0, or B3:1/1. So your Input to be shifted will be put into the BSR "Bit" address and it will immediately appear at B3:1/1 when the BSR is shifted by making the rung logic go true. For a BSR, unlike the BSL, the bit insertion address never actually appears in the instruction or in the program.

To make the BSR shift (move) at the same rate as an external moving object, the input that enables the BSR must be triggered by the movement of an object over some distance or during some time period. To make a bit-shift register work correctly, you have to have an input (or a combination of inputs) that indicates proportional movement in the external world.


I didnt really understand it and when i was testing it on logix pro it didnt work to well, maybe I was doing it wrong. But by the sounds of that wouldnt the notes need to be constant?

Kevin
 
You might want to check this for some concept ideas. This guy keyed off the timing lines. It may not be necessary if you only play one speed or you don't mind modifying your shift timer for different speeds.

Keith
 
No, the notes need only be normal. The timer in the program "holds" the note until 2 x 0.1 seconds before next note appears. You want a small gap between outputs so as not to overlap. If the same note comes up again, it just gets strummed again. If you don't want the gap, you can change the amount subtracted to 0 so that the note is held until the next output.
 
Apparently the Baner Edge sensor that the Minnesota West robot used had the ability to read the notes at the time they fired.
"...when a bright white dot appeared in the middle of a dark colored circle, the Edge tool allowed the sensor detect it.”
Probably no time delays were needed, unlike Kevin's design where the sensors must detect the note one step ahead of the played output.

The article really did not give any details about the PLC program, but was heavily slanted toward the capabilities of the Banner sensor line. I guess the thing to learn is that if you use super-deluxe top-of-the-line sensors, then your PLC programming becomes simpler: see note, play note.
 
Last edited:

Similar Topics

Hello colleagues, Some time ago I started my adventure with programming. With your help and the courses, things are starting to come together...
Replies
13
Views
687
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
152
Hi Please I have zeilo smart relay #SR2A201BD but I don't have it's programming cable. Can I use any general usb/rs232 converter? Or need...
Replies
3
Views
163
Hi, Does anyone have thoughts or know of, can point in the right direction any published materials with a plumbing centric point of you explaining...
Replies
1
Views
166
@ All: what is your best guess on a potential range in increase in efficiency in % (i.e. saved programming hours, greater output, etc.) when...
Replies
5
Views
355
Back
Top Bottom