ControlLogix5555 and eliminating duplicate coordinates from REAL arrays

davidgay

Member
Join Date
Jun 2002
Posts
29
Hi Everybody! Once again I come "hat in hand" seeking advice... I have a ControlLogix 5555 PLC and have placed X,Y coordinate data into two REAL arrays, one for the X coordinate and one for the Y. There may be up to 7500 coordinates in each array. The problem is that there may be "duplicate" coordinates in these arrays (the values may vary + or - .1 and still be the considered the same coordinate). Other than having to look at each X (+ or - a tolerance value), then each Y (+ or - a tolerance value) to determine if the coordinates are the same, is there any "slick trick" you guys have used that will help me eliminate any duplicates from the array without having to look at each set of coordinates one by one? Setting up the tolerance values and doing LIMs to check if the coordinate is in the array is awkward and time consuming to say the least... Any ideas or suggestions would be greatly appreciated...

Thanks everybody in advance for your suggestions and advice.

Sincerely,

David
 
Pierre,

Thanks for the reply, the data is coming into the PLC from a vision system not Excel. I'm just trying anything I can to keep from having to perform what in database terms is a "Cartesian Product" search over 7500 sets of coordinates, as this would take a long time to perform inside the PLC (even though the PLC is REALLY fast). I can determine the coordinates, convert them to strings, send them from my camera to the PLC, deconstruct the strings into REAL arrays and everything for 7500 sets of coordinates in around 12.5 minutes (granted this is the MAX I plan on ever receiving from the camera) but to add another 8-10 minutes really shoots the whole idea in the head... so really I'm just asking if anyone has had to parse very large arrays in the PLC and has a better way than looking at each element one at a time. I'd really like the data to be input to a PC, that does all the "dirty work" and then provides a "clean" array for the PLC to work with, but that adds more cost and potential problems to this project...

Again, thanks for the inquiry and I welcome any suggestions or ideas.

Thanks!

David
 
What I have done in the pas was a bit less CPU demanding but maybee it could give you a start.

Having to determine the position to pick and place windsheilds(for cars) on a production line(PPG), I had to see if the data (position) to pickup the parts was or not the same as another model. And if it was the same for placing the part where a grinding robot would do its work.

So I did a compare function. First data compare to all the other ones. If I got a positive results, I would move the "model number" of this new part to a seperate register. And on and on...

There where a few thousand parts... but I add to do this only once i a whyle (to free some space for really new parts) when the operator would enter a new part position. So it sarted whit only one part, then 2, then 3,... then thousands.

Good luck!
 
Pierre,

That's pretty much what I'm having to do... check each coordinate to see if it is in the array, if it is I don't copy it to a "final" array, but this is really time consuming as each coordinate may appear multiple times in the array... I was hoping someone had another way of doing it... like maybe a "mask" compare would be faster than using a LIM?? You know, just "beating the bushes" looking for a more efficient way to do this. On a PC I'd use a database with the values as "keys" and if I get a duplicates indicated on writing the entry I'd just throw away the coordinate. Then I'd never have any duplicates to start with...

Thanks for responding, I appreciate your feedback on this.

David



"I don't want the code, just the ideas..."
 
You've probably already investigated this, but is there any chance you can weed out the duplicates in the camera BEFORE you transfer to the PLC?

Today's camera firmware is getting pretty powerful!

beerchug

-Eric
 
Eric,

Thanks for the reply, unfortunately the camera is taking up to 350 frames (images) to see the entire surface I am scanning, it can only provide me with the "raw" coordinates based on (0,0) in the current field of view. I may be able to calculate an offset based on the frame (X,Y) in the camera, but to insure that I am detecting all of the targets in the field of view I am moving the camera 1/2 FOV in the X direction or 1/2 FOV in the Y direction accordingly as I am scanning. This insures I don't miss anything because it falls on the edge of a FOV, but it causes each coordinate to be seen up to 4 times! As a result whether the camera is doing the offset calculation or the PLC is doing it the resulting duplications are the same.

Is there a better way to parse an array of REALs than comparing each entry with every other entry in the array using LIMs and just recursively examining the array?

Anyway, thanks again for the reply. Any suggestions or ideas are gratefully appreciated.

David
 
Do you have to do that many times or only for the original setup?

Thats because I suggested Excell... You could DDE link it to the PLC and get this array in a worksheet and then play around with it before sending it back in there.
 
David:

Do you get the coordinates all at once at the end of all the scanning, or do you get a packet of coordinates with each frame? (Not that it makes much difference in the control strategy that I'm going to propose, except that the PLC can be working on the problem while the camera is positioning and gathering data)

You said:
[W]hat I'm having to do ...[is]...check each coordinate to see if it is in the array, if it is I don't copy it to a "final" array.

Instead of taking a coordinate and seeing if there is an duplicate in the array, only compare it to the final array. If it's not there, add it to the end. If a match is found, do nothing.

So at the start, your "final array" will be empty. With your first scan, compare the first coordinate to the null set. No match, so load the number at position 0, and increament the "load position pointer". The second coodinate will only be compared to the first coordinate, added to the postion indicated by the load position pointer (=1), and increment the pointer.

This checking should be much faster, since the size of your recursion loop is only the size of the "final array", and that array will be as much as 1/4 the size of the "source array".

If you are getting the data from the camera between frames, your "final array" will be almost done when the last scan is taken, and should be done a few milliseconds, not 8-10 minutes, afterwards.

I don't think that there can be be any other shortcut. You've got to examine every coodinate and compare it to something. This scheme provides the smallest number of compares.
 
Last edited:
Guys,

Thanks for the replies, I appreciate all the input. Looks like the final solution is to do the "if not present in Final array add it" scheme. I appreciate the idea, it is the most efficient way to get the coordinates into the array without duplications. I was hoping there was a better way and as always you guys have come thru for me again. WAY TO GO! I didn't think it was that much more efficient, but you're right, cuts the elimination process down to a managable size in time and iterations.

You guys will never know how much I appreciate all the info. I regularly "lurk" around in here learning something new each time I visit. I'm still kinda new at this stuff, a real techie, but sometimes ya just can't see the forest for the trees. A fresh set of eyes does wonders giving you a new perspective.

Again, thanks to all of you that responded, maybe next time it will be me that's able to help you guys out...

Many Thanks and Best Wishes,

David ;)
 

Similar Topics

hello... i have a big doubt, i need to send a message from micrologix 1400 to controlLogix5555 trouth ethernet protocol, i did all the config and...
Replies
2
Views
2,362
I'm using 1756-L55 ControlLogix5555 Controller with 2xDI, 2xDO, 1xAI, 1xAO, 3xRTD and 1x1756-ENBT/A for Ethernet communication. Now the problem...
Replies
19
Views
4,934
Okay guys. I converted our Wash program from a ControlLogix down to a CompactLogix. It worked out fine, however, I no longer have the 1756-M02AE...
Replies
6
Views
4,008
I'm in the brainstorming phase of a project and am looking to see if anyone has ideas on the feasibility of some code I'd like to implement. My...
Replies
7
Views
4,783
Hello, I am a new to much of PLC's. I am out of the country installing a system with a controllogix5555. Using a null modem cable I am trying to...
Replies
16
Views
5,118
Back
Top Bottom