Hi all,
I have been asked to implement a simple recipe function on a system running an S7-1200 on TIA Portal.
In Allen-Bradley land, my method would be:
1. Create a UDT with elements for all recipe parameters
2. Create an array of this UDT called Recipe_Database with enough array members to store all my recipes
3. Create a single instance of this UDT called Current_Recipe
4. Use a list selector on the HMI to select a value from 0...n, where the selected value represents the desired Recipe_Database array element (so, if I want to load Recipe_Database[3], the user would use the list selector to select the recipe description that returns a value of 3)
5. Use indirect addressing to copy Recipe_Database[Selected_Recipe] to Current_Recipe
6. Drink beer and celebrate
In Siemens-land, though, there a few things I'm not sure of.
1. What would be the best way to structure my data? Should I create a user-defined data type (Struct, I think???) with all my recipe parameters, then create a DB with as many of these Struct's as required? Or can I create a "template" DB that contains my recipe structure, and then create as many instance DB's referencing that template DB as I need to store all my recipes, plus one for my current recipe? Or something else?
2. Is indirect addressing possible in a Siemens PLC, and does it work the same way? Are there any tricks I need to be aware of with indirect addressing in TIA portal?
Any tips and ideas greatly appreciated - I'm stil learning to think like a German
I have been asked to implement a simple recipe function on a system running an S7-1200 on TIA Portal.
In Allen-Bradley land, my method would be:
1. Create a UDT with elements for all recipe parameters
2. Create an array of this UDT called Recipe_Database with enough array members to store all my recipes
3. Create a single instance of this UDT called Current_Recipe
4. Use a list selector on the HMI to select a value from 0...n, where the selected value represents the desired Recipe_Database array element (so, if I want to load Recipe_Database[3], the user would use the list selector to select the recipe description that returns a value of 3)
5. Use indirect addressing to copy Recipe_Database[Selected_Recipe] to Current_Recipe
6. Drink beer and celebrate
In Siemens-land, though, there a few things I'm not sure of.
1. What would be the best way to structure my data? Should I create a user-defined data type (Struct, I think???) with all my recipe parameters, then create a DB with as many of these Struct's as required? Or can I create a "template" DB that contains my recipe structure, and then create as many instance DB's referencing that template DB as I need to store all my recipes, plus one for my current recipe? Or something else?
2. Is indirect addressing possible in a Siemens PLC, and does it work the same way? Are there any tricks I need to be aware of with indirect addressing in TIA portal?
Any tips and ideas greatly appreciated - I'm stil learning to think like a German