Data Storage and Retrieval...Sort of...

bluenoser337

Member
Join Date
Apr 2003
Location
Nova Scotia
Posts
391
I am hoping to accomplish this in a CompactLogix. I know there is enough memory. It's the method that I haven't figured out yet. I have parts moving past on a conveyor at about 1 part every 3-4 seconds. There are sensors to measure the length, height, and width. I have a user defined data type tag set up where the measured L,W,H get written, and then transferred to an array of the same data type, up to 10,000 parts per day (the array is 10,000 elements). So far, so good. The issue is how to get all possible combinations out of "storage" and count the totals. For example, 4"x18"x10" appears in the array 95 times out of the 10,000. I have to come up with some code to "extract" this info and sort it. I know this has typically been done in a PC application in the past, but I want to accomplish it in the PLC. The line can keep running if the PC goes down, this way and there are other advantages, too. I also considered feeding the different values into the bytes of a 10,000 element DINT array. I'm thinking that might be easier to "query"...but I haven't spent any time on it yet. 00000000|00001010|00010010|00000100 would equal 0,10,18,4 left to right. Wondering if anyone has done anything similar, or if there are any suggestions. Thanks in advance! RB
 
Hello, you might take a look at the FSC (file search/compare) instruction. It will probably take a little more than one instruction to do everything you want to do but that might save you some time.

Otherwise, if you know that you won't have more than say 100 box sizes you could create a second array and compare the items in big array to this new array. If its a new size put it in the small array and start a counter. If it matches something already in the small array just increment the counter. You'll want to put this in a separate task and run it at a faster scan time since it will take a while to complete. Also, only run it when you have to since it will hog your processor time.
 
Just sort of thinking out loud here. If it were me I'd start with this and try to flesh it out:

  1. Assume a limited number of 'standard' box sizes.
  2. Organize these into an array using your binary example.
  3. For each box that passes the dimension sensor, convert to binary and do a FSC on the dimensions array.
  4. Using the found position value as an index, increment a value in a second array. This will be the count of say, 4x10x18 size boxes.
Maybe this is what rbouws is describing.

YMMV
 
Thanks rbouws and Doug-P. I like the FSC ideas, and the predefined sizes array for comparison. Time to experiment with that on a small scale. 🍻
 
Why not seperate by comparision. Once you have your 3 dimensions you have Identified the box size then it's a simple compare to known sizes and store into individual files. You can use the FAL instruction in INC mode. Then your total count would the FAL.pos The first Box will be put in at position 0 and the FAL will increment to position 1 therefore your .pos = total boxes in the FAL.
Once you have your daily totals then one shot the FAL with a (RES) instuction. You also should Reset before the very first time used this will ensure that the first data entered is stored in position 0.

You could make this an AOI. Write the logic once then just fill in your parameters using the AOI instruction.

To tell the truth I'm not sure why you don't just count or Add. If you have more information to query then I could understand the Storage of sizes to marry to additional data. But for just how many then Identify and count.
 
If the parts are just random standard sizes, how many different sizes are there? Why not measure the part and then increment a counter? One counter for each standard size?
 

Similar Topics

I'm trying to figure out a cheap/simple way of saving some recipe and configuration data out of a Compactlogix PLC (L33ER) and Panelview Plus 6...
Replies
3
Views
2,047
Hi guys. Can anyone enlighten me on the easiest way to store the last 20 results of test data on a CJ1 for display on a PT. regards Bob
Replies
2
Views
2,582
I am investigating the pros and cons of different recipe systems for use in the new HMI template at my work. Right now the recipe data is stored...
Replies
6
Views
2,736
Hi all, New to the forum and first time posting, so be gentle please... I'm currently creating a virtual factory on Factory I/O, using RSLogix...
Replies
9
Views
1,598
Hey guys I have a project coming up where I will be doing a lot of data sampling. SLC 5/05 and PV+600. The plc will overrun it's 64k mem in a day...
Replies
6
Views
2,942
Back
Top Bottom