Rslogix 5000 Shift register, move 4 bits at a time

I think 4 bit shift instructions on the same rung would do the job? Please correct me if I am wrong.
Or 4 BSLs in parallel branches, all triggered by the 1 pulse in sequence, so that the first one shifts, then the 2nd takes the result of the first and shifts, and so on through the 4th. Each BSL will need a Bit Address that is the same as the previous shifted-bit location.

Logically it should work, but I have never tried it or seen it done. Each set will need to shift 4 bits 6 times with different Bit Addresses for each BSL, so it seems it will take 24 BSLs x 3 sets or 72 bit-shift registers (or some fancy loops with indirect addressing to minimize the number of BSLs).

Or he could use the multiply-and-move method.
 
Last edited:
where to read the final result ? The words ?

Easy,

Lets say this imaginary machine deals with 4 parts at a time. The first station rotates all the parts 90 degrees. If the 3rd part was not loaded we do not want the machine to attempt to rotate a non existent part. The bit pattern is 1011
So in the DINT that is the shift register, positions MyDINT[0].0 to MyDINT[0].3 contain the bools to be shifted when the BSL is triggered. From my example above bit 2 is off as the part is not present. When this bit pattern is shifted to the first station I would have the following for the rotate part code
XIC MyDINT[0].4 OTE Station1_RotatePartSol1 (Result = On)
XIC MyDINT[0].5 OTE Station1_RotatePartSol2 (Result = On)
XIC MyDINT[0].6 OTE Station1_RotatePartSol3 (Result = Off)
XIC MyDINT[0].7 OTE Station1_RotatePartSol4 (Result = On)
 
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.

Well, Maybe..

But I dont se the bit I at trying to move in this example anyware in my array.
I tried to set the bit high , and then triq the function, but i found no bits in my array afterwards.
 
just a thought
why dont you use 4 shift registers with a single pulse and keep track that way.
it will avoid any miss reads and is not so sensitive to scan times
 
Hello again.

My problem is, that the thing with the BSL, does not ork for me. I am doing something wrong.
I posted my rung ealier in this tread.

The bits dosent seem to enter the registrer when I do as I descriped.
 
It's not hard what you're trying to do. Please post your code.

I´m sure you are right. I think I got the bitshift part working, now I am trying to load 4 bits within 300 ms.

This is what was in my mind. All though when I test this, It not working.. I cant latch my sequence bit (Bitshift_Started.0)

What do you think ?
 
Last edited:
Yeah, you are going the long way to grandma's house and have some errors, like the parallel ONS and how their true condition overlapping or on subsequent scans is going to trip you up....

Do this:

Always make a copy of your photocell inputs and place them into the first four bit positions of a DINT. Use a DINT array if you need more than 32 places mapped in your Ice_Data...

SImple XIC --- OTE instructions will do fine.

WHen your bit shift request occurs, you oneshot from it to a MUL. You MUL the DINT word by 16.

That is it you are done...You now have captured data from the first four bit positions into the next high four bit positions and move all the data up by four bit positions within that word.

So if the trigger is every second, each second the data will shift four bit positions and the live data will be visible in the least significant four positions at all times. You can rearrange the instuctions or add a buffer word so that you keep 32 bits with of indexed data in addition to the live sensor signals.
 
Yeah, you are going the long way to grandma's house and have some errors, like the parallel ONS and how their true condition overlapping or on subsequent scans is going to trip you up....

Do this:

Always make a copy of your photocell inputs and place them into the first four bit positions of a DINT. Use a DINT array if you need more than 32 places mapped in your Ice_Data...

SImple XIC --- OTE instructions will do fine.

WHen your bit shift request occurs, you oneshot from it to a MUL. You MUL the DINT word by 16.

That is it you are done...You now have captured data from the first four bit positions into the next high four bit positions and move all the data up by four bit positions within that word.

So if the trigger is every second, each second the data will shift four bit positions and the live data will be visible in the least significant four positions at all times. You can rearrange the instuctions or add a buffer word so that you keep 32 bits with of indexed data in addition to the live sensor signals.

Ok..

I Understand.

So when I need to extract some bits, how can I move bits over in another register. I know i cant move booleans, so are you suggesting XIC --- OTE there also ?
 
OK, why cant you use the 4 bit shifts in series method mentioned earlier?

Copy this and see how it goes
Rung 1 XIC TriggerBSL OSR StorageBit TriggerBSLONS

Rung 2 XIC TriggerBSLONS BSL Main_EM_Register Shift_Register_Main_EM[0] Ice_In_Row_1_Detected 25 BSL Main_EM_Register Shift_Register_Main_EM[1] Ice_In_Row_2_Detected 25 BSL Main_EM_Register Shift_Register_Main_EM[2] Ice_In_Row_3_Detected 25 BSL Main_EM_Register Shift_Register_Main_EM[3] Ice_In_Row_4_Detected 25

The new tags you will need to create are
Name: Shift_Register_Main_EM Data type: Control[4]
Name: TriggerBSLONS Data type: Bool
Name: StorageBit Data type: Bool

Disclaimer I have had a couple of beers...
 
OK, why cant you use the 4 bit shifts in series method mentioned earlier?

Copy this and see how it goes
This approach is cleaner and has the advantage of executing in one scan versus four scans as shown in the .pdf.
 
I got this to work pretty nice actuly..

Now.. I have 2 words, to extend the number of products. I tried to make the "Masked Move" and I think I get it..
Now I just need to know how I can count the number of high bits in a certain area of the word.

The assignment for me are really to triq an alarm, when some products are missing in the batch.

Capture.PNG
 

Attachments

  • bitshift.pdf
    15.1 KB · Views: 61

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,772
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,103
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,335
Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
95
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
109
Back
Top Bottom