RS Logix 5000- Example of a program possibilities that would Save and Load recipes

Rob S.

Member
Join Date
Sep 2008
Location
Maryland
Posts
739
Good Morning ,

I seen that FactoryTalk View has Recipe Manager , but like you guys "preach", it makes sense to do everything in the PLC program . Sometimes I'm able to come up with some good programming schemes , but I get a mental block on some technique's , that you guys are probably sharp on .

I'm working on a machine that I need to have the operator save and load different recipes . What would be an easy recipe , view , save and load method that can be used .

Thanks so much ,
 
Hi, Rob
I wrote a program for a slurry dispensing system here in Michigan and it needed many recipes. We made a tag (array). There is up to 300 recipes. They use recipe 300 for calibrating, and recipe 99 for just weekend circulation/cycle. The operator inputs the recipe numbers in the HMI and presses a "save" button. The recipe is loaded into the array, and when the slurry control calls for that recipe (operator calls it up) then that recipe is used to mix the slurry. (Produce/consume tags) We're using RS 5K V.20.04. I could send you the controller tag we created and also the recipe routine.
So this is all done in the PLC, with operator input from the HMI.
Hope this helps.
 
Hi Rob.

My first idea would be to use a structured array for a custom UDT. So the UDT hold the recipe details and the array dimensions would depends on the number of recipes; this means its repeatable code and easily expandable as and when required.

For example UDT_Recipe

Recipe_Name- STRING [20]
Mix1_Ratio- REAL
Mix2_Ratio- REAL
Any other variables you may require...

Array [0...however many reciped you want] of type UDT_Recipe.

You can then load any of these arrays into your active recipe- aswell as modifiying on a HMI then saving.

If you are using REALs- make sure you counter for Floating Point Exceptions where necessary otherwise you will crash the PLC.

Regards

Daniel.
 
+1 to the 'array of UDTs' idea. We did the same for a large dry mix company in Michigan, and paired it up with a SQL database using FTTM. Operator would enter a recipe number in the HMI, then the PLC would query the SQL server and load all the ingredients and weights into the UDT to be displayed on the HMI.
 
Look into the FFL and FFU (FIFO load/unload) for storing recipe data. Look into the FLL instruction for clearing data. You probably realize this already but you can not completely eliminate the HMI because the operator has to enter the recipe values in the HMI.
 
I use a nested recipe structure with some basic tag examples like:
Recipe (int)
Param_1
Recipe_Param_1 (real[50])

When saving, I'll do a move of Param_1 to Recipe_Param_1[Recipe]
When loading, just invert it so you move Recipe_Param_1[Recipe] to Param_1
 
It really depends on what you mean by "recipe".

For some, a recipe is just the "amounts" -- setpoints for time, speed, temperature, etc.

For others, a recipe is all that PLUS the sequence of operations. And sometimes that sequence is linear ("Add A. Add B. Mix. Add C. Heat...."), sometimes it's in parallel (Add A and Add; Mix and Add C; when C is done, Heat, even if Mix time isn't done....). Sometimes the sequence is fixed; sometimes it varies per recipe.

Some "recipes" can be run on only one piece of equipment; other plants have multiple paths to run some recipes but not others.

Some have only a few recipes; others have hundreds.

How you design a recipe, and whether it lives in the PLC or in a PC/Server-based database of some kind (which FTView's "Recipe Manager" kinda/sorta qualifies) depends on just what YOU mean by the word "recipe".

---

The second thing that factors in your design is how you want to visualize the recipe to the operator. Your visualization is going to consist of 2 components: Editing recipes and Running recipes.

Fixed sequences are pretty easy; variable sequencers can be trickier, both to Edit and to show where the process is during a run.

For fixed-sequence / setpoint-only recipes, an array of UDTs as others have mentioned work well. In addition to the UDT array (which is your 'cookbook'), you should also make a UDT instance (non-array) for EDIT and another for ACTIVE. The latter allows you to make changes to active batch, without affecting the Master. When editing a recipe, you COP the selected recipe no (via indirect) to EDIT. <Save> COPs it back; <SaveAs> changes the pointer to a different value for the indirect COP.

For system where the phases (an S88 term -- if you're not familiar with the ISA S88 standard, you should spend some time with Google) are executed in a variable way, I've done a few approaches that work well:
(a) something similar to FT View's Recipe Manager, where a bit-pattern is set (in and SQO instruction block!) to trigger what steps a phase gets launched. The phase must be complete to move to the next step.
(b) a Gantt chart type arrangement ("start on step X; end on step Y"), when a phase is launched on step X, but the system doesn't care about the phase until it gets to step Y. This allows for relatively easy parallel but asynchronous operations.

This is a very large rabbit hole, and I'm only scratching the surface. I've built systems where multiple recipes are running on the same line simultaneously, cleaning the front of it while the batch finishes up on the end, or vice versa. But that requires keeping track of equipment allocation, so that one recipe can't use a Unit (another S88 term) until the previous recipe was done with it.

Good luck!
 

Similar Topics

can any one direct me to an example in lader logic of a 4 to 20 analog input. what element do I need to use?
Replies
3
Views
4,081
i gone through rslogix 5000 sample program which comes with the software, but its tuff to coz iam new to rslogix 5000... Anybody suggess..some...
Replies
4
Views
6,590
I have an application using AC drives driven from an analog speed reference. Each has a position command to run to with encoder position and...
Replies
3
Views
8,996
Does anyone know how to set the background colors of instuction blocks (TON, MOV, etc)?
Replies
1
Views
88
Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
95
Back
Top Bottom