Array Problem RS 5K

oldnerd

Member
Join Date
Mar 2011
Location
Al
Posts
94
Gentlemen,
I'm new to RSLogix 5k. This is my second project. I have ran into something I could use some advice on.
Sorry if this is a little long. My project is drilling holes in a pipe to make a manifold using cip motion. The way I was going to do this way stepping through an array one element at a time. Half way through the project my boss tells me that we have to drill the holes by the largest number of holes of the same size to the least number of holes by size. I tried a 2 d array but can not get it to sort the holes by size and row position.
Any advice would be appreciated.
(and yes I have read a ton of post and the AB pdf's)
 
So you have an array of holes, each denoting what size the hole is, but I don't think it's that simple. Surely you have the X, Y coordinates of each hole as well. I suspect that you will next need to sort by location so as not to require your positioning system to randomly drive around to the next hole - but that's another story. The point is that you must be using a UDT or already multi-dimensioned array or multiple arrays?

I guess I would create another array that is as long as you need for the number of different hole sizes you have. Then walk down through the array of holes and simply increment the count of each hole size as you encounter them in the hole array. At that point you can sort that array to get you to where you can start with the most used size.

Then, as you are processing each hole in the hole array, when you index to the next hole, if it doesn't match the current drill size you're using, pass it on by and go to the next hole.
 
I did create a few UDT's to help organize the project and to make use of the array. I guess what I'm getting stuck on is how to sort the holes by size and sort them to there position. I was ok when I could do them step by step by stepping through the array. When I was informed it had to be executed by the most number of holes the same size in order it threw me for a loop. This meant I had to sort the data, move the data in and order that is scattered all over the place. The reason for this is to keep from changing tools so often. Am I missing something or on the right track?
 
I can't tell if you're on the right track - I haven't seen any of your work.
I implied that you would have to make multiple passes through your hole array - one time for each hole size - each hole in the array is examined to see if it matches the currently mounted tool - if so, then run your drilling cycle, if not, skip on to the next hole in the array.
After all the holes have been examined for match, move on to the next hole size and re-process the hole array.
It will be tedious but that's the way I would approach it.

Sorting the holes for location would be a separate task to put them in order by location, if you need that (I don't know how physically large your manifolds are).
 
If your UDT looked like this:

Size - dint (1-10 if you have 10 drill sizes)
X_Loc - dint
Y_Loc - dint
X_Ord - dint (use this to sort for X_Location)

Of course, I don't know anything about your process - how you get your holes assigned to X, Y, Size, so it's a little hard to advise you on specifics.
 
I did create a few UDT's to help organize the project and to make use of the array. I guess what I'm getting stuck on is how to sort the holes by size and sort them to there position. I was ok when I could do them step by step by stepping through the array. When I was informed it had to be executed by the most number of holes the same size in order it threw me for a loop. This meant I had to sort the data, move the data in and order that is scattered all over the place. The reason for this is to keep from changing tools so often. Am I missing something or on the right track?

your method is correct

the program flow is
sort
then step through the sorted array drilling the holes

While you are stepping through the array of holes the array must be locked from changes by operator etc

read this post for sorting http://www.plctalk.net/qanda/showthread.php?t=22803

easiest is to have the PLC given a sorted array in the first place
 
Thanks, The manifolds are 3' to 10' and 1" to 4" in diameter copper.We are using a Flowdrill and tapping the holes. Being new I was surprised I had no issues with the motion even the gearing and tapping. But something as simple as the sorting issue has been kicking my back side. Thanks for the help I hope to get a handled on it now.
 
I echo the methods implied in other posts. Add a boolean to your UDT and start by clearing that element in the array.

1. Step through the array to find the first hole whose boolean is cleared, if there are none left go to #3. Else, load its bit/tap and process. Mark it as done by setting the boolean element.

2. Progress to the next, if there are none left go back to #1. If there is one test if it is the same size hole as the bit you have loaded. If it is the same then process and mark it else skip it. Repeat this step.

3. Done

If the grouping was to minimize tool changes they don't need to be sorted. The number of changes will be the same whether they are sorted or not.
 

Similar Topics

Hi guys. I am using RS Studio v24 and I have a structure BOOL[2048] inside. When I give project to our HMI designer he sees that array of bools...
Replies
6
Views
2,187
I'm having a problem creating variable tag array in Citect SCADA V7.40. I looked every possible help, user guide... but no matter how i set...
Replies
2
Views
4,752
Though i was working with add-ons for a lot of times recently i am stuck in a simple proble. I have a TAG READ_DATA[502]-INT ARRAY R/W I am...
Replies
2
Views
1,865
Hi! I modified some code, probably from member LD, to make a function element := ReadFromArray(firstElement : ANY, offset : INT) It seems...
Replies
2
Views
4,157
I have 1 TAG for a column. An array of 500 values But for some reason it doesn't work anymore, maybe because I try todo the same with an...
Replies
12
Views
6,973
Back
Top Bottom