How to track a part using a "shift register"?

Is it the case that the first item entering the transport-system is ALWAYS the first item leaving the transport-system?

Do the items, in fact, move through the system in a FIFO shift-register manner?
 
CLX is going to be different, but with PLC5 and SLC500 series processors, I used a single Integer as a pointer, and indirect addressing (from that pointer) to three different files (all N type) to track specifics. This allowed me to track moisture content, grade, and thickness. All relevant to quality for our process. It looked something like this:

Part 1 = N7:100 Value 1

Part 2 = N7:100 value 2
Part 10 = N7:100 Value 10

For each part MOV


N10:[N7:100] equals Moisture

N11:[N7:100] equals Grade

N12:[N7:100} equals Thickness

This data determined the location to stack the product.


Each new part was the next in a FIFO. The FIFO kept track of position, the data files kept track of each part. The FIFO allowed the use of Integers. In your case The FIFO would be set to 10 parts.



This was fine for low production numbers (<500 per shift) but could cause trouble in faster machines, and more parameters. If you are trying to keep the data for each part throughout the shift. In that case, the data files would be rather large. = Lots of memory.



As each part exited the process, its data was imported into production totalizers/averagers for production sheets. At the end of the shift, data files were cleared. During shift operations we could track progress and quality and make adjustments when needed.
Edit: N7:100 not N7:10
 
Last edited:
Terry Woods said:
Is it the case that the first item entering the transport-system is ALWAYS the first item leaving the transport-system?

Do the items, in fact, move through the system in a FIFO shift-register manner?

Terry,
You beat me to the send key. ;)
 
Terry Woods said:
Is it the case that the first item entering the transport-system is ALWAYS the first item leaving the transport-system?

Do the items, in fact, move through the system in a FIFO shift-register manner?

yes...they move in a FIFO manner.
 
Read up on address modes.

Indirect addressing with an integer used as a pointer like PLChacker is describing will probably work quite well for you.

Terry's suggestion of loading up a FIFO buffer with your data is also nice because the logic will mimic what's happening in the physical world a little more closely and may be slightly easier to follow (if your product is always moved through the stations sequentially).

Either way you're going to want to understand indirect and indexed address modes before you try to implement either solution.
 
Why are you talking about indirect addressing?

Silverloop is using a Control Logix. Silverloop needs to write a UDT that has fields for all the data that defines eash part. He then needs to create an array using the UDT to define each element. The array must be defined to be long enough to hold the ten items.
 
Array of UDTs is quick, easy, a snap to follow, and even easier to write in ST if you've ever used ST before. If not, the learning curve is quite low.
 
For the walking conveyor section, it shouldn't even need an encoder (unless there's a function that needs doing mid travel), the walking. There should be a way to indicate the movement and stop positions which could be used.
 
Peter Nachtwey said:
Why are you talking about indirect addressing

Well.... I figure he needs to refrence the data in that UDT array somehow. o_O

Why are you telling Sliverloop something he stated in the first post of this thread?
 
PeterW said:
For the walking conveyor section, it shouldn't even need an encoder (unless there's a function that needs doing mid travel), the walking. There should be a way to indicate the movement and stop positions which could be used.

you are correct. there is no enconder involved there at all...when the beam is fully extended, raised to lift a part, fully retracted and then lowered, the part is in the next position. there is no proximity switch though to truly verify that a part has made it to the next position. hopefully little will go wrong with this walking sequence because i will be shifting the data somehow at the same time.
 
monkeyhead said:
Well.... I figure he needs to refrence the data in that UDT array somehow. o_O

Why are you telling Sliverloop something he stated in the first post of this thread?

where is the best place to begin to understand how to set this structure up and then to reference this data as the parts move through the system?
 
Say you have a DINT array called My_Array that has 3 elements:
  
My_Array
|-My_Array[0]
|-My_Array[1]
|-My_Array[2]


If you want to use the value of the third element you address it as: My_Array[2].

Now say you have another single DINT called My_Pointer and My_Pointer = 1.

My_Array[My_Pointer] would 'point' the value of My_Array[1]. Changing the value of My_Pointer to 0 would now give you the value of My_Array[0].

This is indirect addressing.

PLCHacker was suggesting that every time your walking beam moves everything to a new location you increment the value of a pointer and use this to refrence you product data in a table.

Now suppose you have a UDT called Box_Dimensions. It has 3 elements. All three are DINTS:

Box_Dimensions
|-Length
|-Width
|-Height


Now create an array of this UDT called Box with 3 elements

Box
|-Box[0]
|-Length
|-Width
|-Height
|-Box[1]
|-Length
|-Width
|-Height
|-Box[2]
|-Length
|-Width
|-Height


If you need to know the lenth of the second box:

Box[1].Length

The constant 1 can be replaced with a pointer and indirect addressing as shown above can be used.
 
monkeyhead said:
Say you have a DINT array called My_Array that has 3 elements:
 
My_Array
|-My_Array[0]
|-My_Array[1]
|-My_Array[2]


If you want to use the value of the third element you address it as: My_Array[2].

Now say you have another single DINT called My_Pointer and My_Pointer = 1.

My_Array[My_Pointer] would 'point' the value of My_Array[1]. Changing the value of My_Pointer to 0 would now give you the value of My_Array[0].

This is indirect addressing.

PLCHacker was suggesting that every time your walking beam moves everything to a new location you increment the value of a pointer and use this to refrence you product data in a table.

Now suppose you have a UDT called Box_Dimensions. It has 3 elements. All three are DINTS:

Box_Dimensions
|-Length
|-Width
|-Height


Now create an array of this UDT called Box with 3 elements

Box
|-Box[0]
|-Length
|-Width
|-Height
|-Box[1]
|-Length
|-Width
|-Height
|-Box[2]
|-Length
|-Width
|-Height


If you need to know the lenth of the second box:

Box[1].Length

The constant 1 can be replaced with a pointer and indirect addressing as shown above can be used.

so the pointer would represent the ten possible locations that a part could be present?
 
Peter Nachtwey said:
Silverloop is using a Control Logix. Silverloop needs to write a UDT that has fields for all the data that defines eash part. He then needs to create an array using the UDT to define each element. The array must be defined to be long enough to hold the ten items.

do you know of any sample code i could look at for Controllogix?
 
Yes. Here is some sample code.

My_Part UDT has members:

Property1
Property2
Property3

Declare an array of 10 My_Parts called SilverLoops_Parts
SilverLoopParts[10]
Declare a DINT called Pointer.

Now you can read/write data to an array of UDTS using the DINT as a pointer.

Example in STL:

(*This reads parts from the UDT array to a variable*)
MyReadExampleProperty1 := SilverLoopParts[Pointer].Property1;
MyReadExampleProperty2 := SilverLoopParts[Pointer].Property2;
MyReadExampleProperty3 := SilverLoopParts[Pointer].Property3;

(*This writes parts from a variable to a UDT array*)
SilverLoopParts[Pointer].Property1 := MyWriteExampleProperty1;
SilverLoopParts[Pointer].Property2 := MyWriteExampleProperty2;
SilverLoopParts[Pointer].Property3 := MyWriteExampleProperty3;

Pointers and Arrays are basic programming concepts with very good tutorials online available by googling it. Placing the proper syntax in STL on the CLX is easily done by using the help file.
 

Similar Topics

Using an Encoder to track part position Hi, I have a Micrologix 1100 that I will use to add an inspection station on a line that processes 1000...
Replies
5
Views
3,248
Good Morning Everyone, I have a quick question and I am not sure if it is possible with PLC code. I have 6 conveyors, Someone(worker) will...
Replies
4
Views
3,487
Hi, I have some numeric input fields and I would like to track whenever a change is made to them. For example if an user changes temperature...
Replies
1
Views
867
Any help appreciated, Proposed question: I need to track parts to count the rejects in a rotating machine but having no luck tracking proper...
Replies
7
Views
2,355
Right now my system is using RFID tags on the load bars. Im trying to figure out how to implement error correction in this system. In the past...
Replies
2
Views
1,115
Back
Top Bottom