Shift register help, Siemens s71200

Bcurry135

Member
Join Date
Dec 2020
Location
Mid Ulster
Posts
36
Hi everyone

I am completely new to using shift registers and am a bit stuck, my shift register works as should, it is for an overhead conveyor and an operator selects what line the product should go to. I have used a separate shift register for each line and it works as should, but I need to be able to select from an hmi when the valve should open to let product go in to the correct line. I have tried this with a compare instruction with the value from hmi comparing against the value of the dWord I am shifting but it doesn’t work. I know I’m probably doing something very silly but I’m still learning!
 
I don’t currently have access to laptop, basically I need a different method instead of a shift register shifting through a DWord, as from the hmi each line changeover will have a set point which will be when the valve will open, and this set point should be changeable from day 0 to 120. Example of the compare instruction is
If “GlobalDB.dWLine1Shift”= Line1SetpointHMI

Then

Line1Valve:= TRUE;

End_If

And say Line1SetpointHMI is 21 , I would want when the register has shifted through 21 times to operate the valve. The setpoint also represents the amount of pitches of the line, so after ‘21’ pitches I want this top happen
 
Last edited:
I am not sure I understand the process yet. This is what I am reading:



A product is added onto the the beginning of an overhead conveyor, and downstream from there, there are several possible exits along that conveyor to various downstream processing "lines" (e.g. Line1, Line2, etc.). Those exits are controlled by valves (Line1Valve, Line2Valve, etc.).


When a new product is pushed onto the beginning of the conveyor, the operator uses the HMI to select to the Line to which that product will exit the conveyor at some point in the future. The PLC needs to model the position of that product on the conveyor, and trigger that selected Line's Valve when the product reaches it to deliver the product to the selected Line.



Is that close?




[from memory: "James, you are the most excellent chap alive, but by the law* you lack the gift of clear communication."


* Lawd?]
 
Last edited:
Apologies I should have explained in more detail. Yes product will come into the production room where an operator stands, he will select which line the product should go to and then product will transfer on to the main line then. Each line has a changeover valve and this valve will open when product gets near the changeover, there is a proximity switch on the main drive wheel which determines how many pitches of the line until the selected changeover should open. The settings for pitch of each changeover should be changeable from the hmi. So for example line 3 is selected, line 3 has a pitch setting of 47, I want to shift this through 47 times and then the changeover will open.

A bit shift register doesn’t work for me as I can only Use a compare Instruction against bits, I am probably missing something very simple but I just can’t seem to grasp it
 
Will a counter not suffice?

No as there is 6 lines in total, so if a product was selected to go to line 6 which pitch setting is 130 I could end up getting products sent to the wrong destinations.

I was thinking of having an array of ints, when a product is selected for whatever line then move the pitch setting for that line into the array, then shift it up through that array until the array int equals the pitch setting for the line that has went in, but I am unsure how to implement this?
 
Not sure I have this right but I did a similar thing some years ago, I created a shift register of about 1000 registers, there was a prox on the conveyor that was used to shift the data, a box would come onto the conveyor, read by a bar code reader and the bar code (very simple 0-200) was loaded into the shift register, we knew what address of the shift register was at each divert conveyor so when the box code reached the shift register at say lane 3 it compared that with lane 3 bar code & diverted it. The operator could enter the bar code for each lane on the HMI so any box that had that bar code would divert down that lane.
It was a little more complex than that but essentially that is how it worked.
So one long shift register, a variable for each lane. when the register in the shift compared to the lane register it diverted.

boxes entered into Shift Register
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
........L1..........L2..........L3..........L4......L5......L6 lane pos
........33..........04..........45..........21......32.....56 Box barcode for lane

So if a box entered onto the conveyor at position 1 was 04 then it was passed down the shift register lane 2 had a value of 04 in it so when pos 9 in the shift register matched Lane 2 register it diverted it.
In reality there were 17 lanes and the shift register was over a thousand words long, so far larger than the example but same principle.
 
Can more than one product be on the main line at the same time?

E.g. if a first product is destined for line 6 at main line pitch 130, can a second product be pushed onto the main line, destined for any line, before that first product reaches the line 6 valve at pitch 130?

If yes, can two products be on the main line at the same time, at different pitches of course, but destined for the same line/valve?

What is the pitch rate e.g. Hz => how many times the pitch prox fires per second?


Are you using structured text (I think Siemens calls it SCL)?
 
Last edited:
Not sure I have this right but I did a similar thing some years ago, I created a shift register of about 1000 registers, there was a prox on the conveyor that was used to shift the data, a box would come onto the conveyor, read by a bar code reader and the bar code (very simple 0-200) was loaded into the shift register, we knew what address of the shift register was at each divert conveyor so when the box code reached the shift register at say lane 3 it compared that with lane 3 bar code & diverted it. The operator could enter the bar code for each lane on the HMI so any box that had that bar code would divert down that lane.
It was a little more complex than that but essentially that is how it worked.
So one long shift register, a variable for each lane. when the register in the shift compared to the lane register it diverted.

boxes entered into Shift Register
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
........L1..........L2..........L3..........L4......L5......L6 lane pos
........33..........04..........45..........21......32.....56 Box barcode for lane

So if a box entered onto the conveyor at position 1 was 04 then it was passed down the shift register lane 2 had a value of 04 in it so when pos 9 in the shift register matched Lane 2 register it diverted it.
In reality there were 17 lanes and the shift register was over a thousand words long, so far larger than the example but same principle.

Thanks very much for your input, that sounds a very similar concept to what I am trying to achieve. However I am just not sure how to implement shifting the data through the register?
 
Can more than one product be on the main line at the same time?

E.g. if a first product is destined for line 6 at main line pitch 130, can a second product be pushed onto the main line, destined for any line, before that first product reaches the line 6 valve at pitch 130?

If yes, can two products be on the main line at the same time, at different pitches of course, but destined for the same line/valve?

What is the pitch rate e.g. Hz => how many times the pitch prox fires per second?


Are you using structured text (I think Siemens calls it SCL)?


Yes that’s correct there could be up to 4 products on the line and they could all be for the same line. I am basically trying to implement what parky explained, only the “pitch setting” of each valve from the hmi is basically how many pitches from the product enters until it reaches the destination, if that makes sense.
 
I was going to suggest a shift register per product on the line, when shift register = bit value for relevant pitch count then fire diverter + release shift register for next product.
 
This is what I have tried but hasn’t worked as I would like, whatever the “pitch setting” from hmi for each valve is, that will essentially be however many pitches of the line until the valve should open, I want to be able to tweak this so say it needs to open 1 pitch earlier or 1 pitch later. I don’t know how I can achieved this with a bit shift register
 

Similar Topics

Hi I am fairly new to codesys 3 but I'm currently trying to make a little project using 4 cameras, a sensor and a conveyor belt each camera take...
Replies
7
Views
3,688
Posted previously but had the wrong info, hoping to get new advice. Being a mechanical engineer, I'm not very experienced with PLCs, and what...
Replies
7
Views
2,454
I'd like to start by saying that my background in engineering is mostly mechanical, and I have a tiny bit of experience with AB and RSLogix (to...
Replies
10
Views
2,651
Hello dear experts! just started learning STL and tried writing a program that writes the status of a particular bit M0.1 on 80 bits of...
Replies
2
Views
1,756
hello people, im totally NEW in plc. i'v read reference of ladder diagram (OMRON PLC CPM1A-20CDR). why do people use 253.14 as data input of...
Replies
6
Views
4,570
Back
Top Bottom