This program is now finished, but it got messy...
I have material handling and mixing equipment with multiple ingredients. Customer wanted a recipe system that contains 40 items. The items consist of ingredients, timers, and holds/pauses where the operation stops until the operator OKs it.. They also want to control the order in which these things happen.
Obviously this was tricky as I had to tie any item to a order number and keep them together. I also had to do a sorted list showing all this stuff in the order the operator entered. I have only been a programmer in the field for a little over a year, so my method was probably a bit primitive for some of you veterans. What would your strategy be to avoid checking every combination at each operation?
*Stop reading if you don't care about how I tried to do it.
I initially made two UDT structures. One for items, one for recipes. The item UDT held what the item was (timer, material, etc.) and a unique item ID. The recipe UDT had a recipe_1.pos1 (upto .pos40) and when a item was added the item ID was put into the proper .posX dint with some indexing logic. The HMI had the list of items available, then an add button. So the order the add button was pressed created the order in the recipe. The items were edited on a different screen where you would make a name for the item, where it came from physically(if it was a bulk for instance), or how much time if it was a timer. This made it extra easy to "sort" the list, as I would just make a screen that list the recipe UDT .pos1-40. The sort was easy, however when doing the custom sequence I still had to check each .pos of the recipe UDT against all created items to see what I was actually doing at that position.
However the customer didn't like having to input so much info, so I had to actually hand create 70+ items and manually check everything. Such as 12 separate timers where they just put the order in. IE timer 1 order num 22 would call up that timer when the sequencer reached 22. So even though there were only 40 things to do, I had to look at all 70+ to see if any of them are in the order.
Sorry for the long post, but this got complicated and now my brain hurts lol.
I have material handling and mixing equipment with multiple ingredients. Customer wanted a recipe system that contains 40 items. The items consist of ingredients, timers, and holds/pauses where the operation stops until the operator OKs it.. They also want to control the order in which these things happen.
Obviously this was tricky as I had to tie any item to a order number and keep them together. I also had to do a sorted list showing all this stuff in the order the operator entered. I have only been a programmer in the field for a little over a year, so my method was probably a bit primitive for some of you veterans. What would your strategy be to avoid checking every combination at each operation?
*Stop reading if you don't care about how I tried to do it.
I initially made two UDT structures. One for items, one for recipes. The item UDT held what the item was (timer, material, etc.) and a unique item ID. The recipe UDT had a recipe_1.pos1 (upto .pos40) and when a item was added the item ID was put into the proper .posX dint with some indexing logic. The HMI had the list of items available, then an add button. So the order the add button was pressed created the order in the recipe. The items were edited on a different screen where you would make a name for the item, where it came from physically(if it was a bulk for instance), or how much time if it was a timer. This made it extra easy to "sort" the list, as I would just make a screen that list the recipe UDT .pos1-40. The sort was easy, however when doing the custom sequence I still had to check each .pos of the recipe UDT against all created items to see what I was actually doing at that position.
However the customer didn't like having to input so much info, so I had to actually hand create 70+ items and manually check everything. Such as 12 separate timers where they just put the order in. IE timer 1 order num 22 would call up that timer when the sequencer reached 22. So even though there were only 40 things to do, I had to look at all 70+ to see if any of them are in the order.
Sorry for the long post, but this got complicated and now my brain hurts lol.
Last edited: