Rslogix 5000 Shift register, move 4 bits at a time

sorenlyder

Member
Join Date
Jul 2014
Location
Rødekro
Posts
22
Hey.

I need some input on how to solve this task i am struggeling with.

In the picture I attatched to this post, i tried to display what my task is about.

I need to every time I get a pulse, move 4 bits 4 positions in an shift register.
I havent been able to make it work in rslogix 5000 with the LSB or RSB instruction, but this is also the first time i have tried to use thoose instructions.

I would say I have some experience in Rslogix 5000, so I am no rookie, I just never worked with this kind of assignment before.

In total i need 3 shift registeres, and the one that is displayed in the picture, are Nr. 2 of them, but i think that if I could just get some help to this one, then I would be on my way to solve thoose other two afterwards.

Please give me your inputs on what U think.

Thanks in advance.

shift register.jpg
 
You can use a dint array as the the array parameter of the instruction. This allows you to make a VERY long shift register if you so desire.

I think to get around the loading 4 bits requirement you could have 4 BSL instructions on the one rung executing one after the after. This will mean that if you executed the rung on a one shot for example you would load in the first bit then shift left, then load in the second bit then shift left etc until all 4 bits are done. When the rung has completed you would have loaded in all 4 bits and shifted the register 4 places to the left.
 
Hello HJTRBO

I was thinking the same thing.
I just have trouble setting it up in RSLogix 5000.
The BSL seems to me a little different than in the logix 500.

I have seen a number of walk though´s on youtube, but all in the logix 500 program.
I need to convert it to logix 5000 somehow.
 
I don't have the software with me but try this to get you started.
Steps:

1)Create tags
MyBSLSourceBit BOOL[3] (This is an array of bools. Just for now only the first one is used for my first BSL instruction)
MyBSLArray DINT[3] (This is my shift register and is 4 DINT's long (VERY LONG))
MyBSLControl CONTROL[3] (This is the control data area that the instruction uses to make work. I won't have much to do with this just yet)

BSL
Array ==> MyBSLArray[0]
Control ==> MyBSLControl[0]
Source ==> MyBSLSourceBit[0]
Length ==> 128
 
Yes, I can... But..

Maybe I Miss-explained a single thing.

every second, I need to load another 4 bits into my array, and then move the existing 4 bits 4 steps to the left(or right, no difference for me).

So.. I dont know if I get ahead of my self here, but is it really nessecary with a hole array? cant I just use i single Dint, and move bits in one direction, or what do you say?

I will try to test your solution now.
 
If you use a Shift Register (which only shifts 1 bit each time it is triggered), you will somehow have to create a pulse multiplier that takes your 1 pulse and turns it into 4 pulses in the time before the next single trigger pulse occurs.
Multiply your DINT Value by 16. This will shift the 4 bit pattern 4 positions.
CWA's multiplication method works very well using only a single pulse for each 4-bit left shift. If you need to put the shifted bits into the same DINT, you would use a Masked Move each time (with the Mask bits controlled by an indirect address), and only move the 4 new bits after the multiplication.

Shift 4 Bits Left 4 Places.JPG
 
Last edited:
you will somehow have to create a pulse multiplier that takes your 1 pulse and turns it into 4 pulses in the time before the next single trigger pulse occurs.

I think 4 bit shift instructions on the same rung would do the job? Please correct me if I am wrong.
 
I am not getting the DN(done) bit when I try to toogle the instruction.
Could it be you're just not seeing the DN bit? Is the instruction acting on the operand? I mention this because with the one shot in the rung the DN bit will only be one for one scan - it's unlikely you'll see such a short event. If there's doubt, use the DN bit to set a latch so you'll have a record of it.
 

Similar Topics

Hello All, Please i am making a shift report in Tons in Rslogix 5000 for three shifts,morning, afternoon and night for every 8 hrs. The challenge...
Replies
2
Views
1,800
I've got three INT words in RSLogix 5000 Version 12.06. They are Sawset, Sawset1, and Sawset 3. I have three momentary pushbuttons set to assign a...
Replies
11
Views
2,140
Hallo Everybody ! I was a little confused here. I try to shift a structure with FFL What I want is to shift a structure of values from Array[2]...
Replies
28
Views
27,611
Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
2
Views
135
Back
Top Bottom