Recipe sort in logix 5000

Rcochran@ee

Member
Join Date
Sep 2013
Location
Cleveland,TN
Posts
22
I have a project where I have to sort 500-1000 recipe in either numerical or by name (that hasn't been nailed down yet) but then if they insert a new recipe it has to go in order. I was reading some post on bubble sort and some other sort which never had a name and I am a little confused. I am not a great script writer but can copy and paste like a madman. So if anyone out there has a solution please let me know where to start. :confused:
 
This is a useful tool for choosing a sorting algorithm. Each has it's own benefits, depending on the initial conditions.

Bubble Sort rates badly for random data, but works quickly when the data is "nearly sorted", which will be the case if you have initially sorted the data, then just add a new one. If you perform a sort after each recipe insertion initially, it will probably serve well enough for future additions.

In the scenario above, though, Insertion Sort would probably the best, since you will only be "inserting" one recipe at a time.... Bubble sort needs to make an additional pass through the data, its "termination" is flagged when no entries are swapped.

Will you actually need to sort 500-1000 recipes? or will it be a case of putting each new one into its correct "slot"?


A good explanation of sorting techniques is on youtube, although old, it's still a valid resource. The ending sequence at 26:35 puts it all into perspective, although different results would be seen if the data were initially "nearly sorted".
 
Last edited:
I am curious as to why you need to sort recipes? Is it merely so that you may list them in alphabetical order?

I intended to ask the same question, but thought OP must have his reasons.

I would not sort the recipes themselves, too much data to move, but have a separate array, pointing to where they are stored.

I hope the links i gave help him to choose a sorting algorithm that best fits his needs....
 
There is a sort built into Logix5000, the instruction is SRT, and is available in LAD and ST.

That being said, I have much hate for recipes stored in the PLC, and much prefer having them in an external database. Even if that means needing to add a module to handle PLC to DB communications. The eATM module is excellent for this.
 
There is a sort built into Logix5000, the instruction is SRT, and is available in LAD and ST.

That being said, I have much hate for recipes stored in the PLC, and much prefer having them in an external database. Even if that means needing to add a module to handle PLC to DB communications. The eATM module is excellent for this.

Having the recipes in the PLC, and the production schedule in the PLC, means that production can continue for the whole of the schedule, without having the "external database" available.

I prefer the recipes stored in the PLC if space permits, as it makes off-line testing/simulation easier (i.e. you don't need to replicate your SQL server etc.). The PLC controls the process, so why shouldn't it have the process variables it needs to make the product.

Of course I can see the advantages of having external recipe management, but the manufacturing processes shouldn't rely on this per se.
 

Similar Topics

I'm using legacy recipe to download a recipe to the PLC. A little background, the recipes are large. They are broken down into 6 tables, each 16...
Replies
2
Views
80
Hi guys, got one problem PLC model fp-xh c60t and HMI model TG765S-MT I've encountered an issue which is the recipe file went missing if i swtich...
Replies
0
Views
74
Can anyone help me find where is recipe plus or recipe manager in View desginer(studio 5000) software. i want to create an recipe but i am unable...
Replies
2
Views
144
Need to add new tags to some recipe inside a Wincc Tia Hmi . Do we have an option to download the recipe , with the newly added elements ...
Replies
0
Views
230
Hello all. Is it possible to create a shared folder between my laptop and my PV+ 7- standard......2711P-T10C21D8S Series D? What I would like to...
Replies
4
Views
419
Back
Top Bottom