You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 4th, 2018, 12:48 AM   #1
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,693
TIA Portal Indirect Addressing/Recipe Management

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
  Reply With Quote
Old April 4th, 2018, 01:49 AM   #2
tarik1978
Member
Morocco

tarik1978 is offline
 
Join Date: Mar 2010
Location: casablanca
Posts: 399
Have a look at these links
https://support.industry.siemens.com...dti=0&lc=en-WW

https://support.industry.siemens.com...dti=0&lc=en-CN

Last edited by tarik1978; April 4th, 2018 at 01:51 AM.
  Reply With Quote
Old April 4th, 2018, 02:21 AM   #3
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,693
I hadn't thought of using the HMI recipe management option. Can anyone comment on it's usability? The PanelView Plus recipe management solution is pretty ordinary and I've always steered well clear.

My HMI here is a KTP600 Basic (full part number 6AV6647-0AD11-3AX0) - does anyone know if this particular HMI has any recipe management functions?
  Reply With Quote
Old April 4th, 2018, 02:51 AM   #4
Rob...
Supporting Member
United Kingdom

Rob... is offline
 
Join Date: Jul 2016
Location: Manchester
Posts: 145
I've built recipe systems using the same method you describe in the OP.

I've tried the HMI recipe manager, it's ok. A little basic.

Indirect addressing works in Siemens. One thing I haven't tried is multi point indexing like I have in Rockwell. E.g Example_Tag[X,Y]
  Reply With Quote
Old April 4th, 2018, 03:20 AM   #5
sigmadelta
Member
Canada

sigmadelta is offline
 
Join Date: Apr 2016
Location: From Canada - Living in Bulgaria
Posts: 798
I have used the HMI recipe management. It stores all recipes on the HMI itself. I've found it very straight forward to use. You can even upload values from the PLC and store in a new recipe data record if, for example, the values were entered in several I/O fields.

The severe drawback in the Basic panels is that you cannot store the recipes onto a memory card or USB stick. The only way to do a backup of recipes is to manually use the backup/restore method in ProSave or WinCC.

KTP600 Basic Recipe management:
● Number of recipes: 5
● Data records per recipe: 20
● Entries per data record: 20
● Size of internal recipe memory: 40 kbyte
● Recipe memory expandable: No
__________________
Freelance Automation Programmer
  Reply With Quote
Old April 4th, 2018, 03:23 AM   #6
CommissioningMan
Member
Denmark

CommissioningMan is offline
 
Join Date: Sep 2017
Location: Denmark
Posts: 60
I have made almost exactly what you describe in TIA14 for S7-1500 with Comfort panels. Depending on your controller and number of recipes, you can store your recipes directly in the retain memory. My system had 1000 recipes with arrays of a hundred LREALS and Strings, so retain memory was right out. I had to use the memorycard with an Array Datablock (DBL) stored on it, and then use read/write functions to load the wanted recipe with indirect addressing. Slow as hell.

You create a PLC Data Type (UDT) and then an array of that datatype. You can use the same DB for e.g. "StoredRecipes" (Data type: Array[0..100] OF typeRecipe) and a single "ActualRecipe" (Data type: typeRecipe)
If you need to edit your recipes, you just edit the PLC Datatype "typeRecipe" and all references are updated.

I'm sure the HMI recipe manager is great if you are mixing juice or paint. But who does that?
__________________
All things Siemens and Beckhoff. Please let it be Beckhoff.
  Reply With Quote
Old April 4th, 2018, 05:59 AM   #7
travispedley
Member
United States

travispedley is offline
 
Join Date: May 2012
Location: Sanford, NC
Posts: 91
I use the recipe functions in Comfort/WinCC when possible for simple setups.
I've only done one complicated recipe setup in a 1200 and it sucked.
I had to store the recipes in the load memory and load/store them there.
READ_DBL & WRIT_DBL were the functions I had to use to do it.
Inside the DB you set up for storage, go to properties and you have to CHECK the Only store in load memory box.
This will allow you to use a much larger DB than you can fit in the Work memory.
Attached Images
File Type: jpg loadmemory.JPG (39.3 KB, 15 views)
File Type: jpg read.JPG (30.9 KB, 9 views)
File Type: jpg write.JPG (32.8 KB, 6 views)

Last edited by travispedley; April 4th, 2018 at 06:04 AM. Reason: totally hit enter before i was done, added screenshots
  Reply With Quote
Old April 4th, 2018, 11:12 AM   #8
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,048
On plc you can have multiple DB-blocks with same variables on same order. (only DB name and number changes)
I think that with SFC20 you can copy full DB from one to another.
So if you make indirectly copy syntax to SFC20, it should be possible to copy variables between DB blocks.
On HMI then is only needed recipe number field and execute buttons.
  Reply With Quote
Old April 4th, 2018, 03:49 PM   #9
spaderkung
Member
Sweden

spaderkung is offline
 
Join Date: Aug 2007
Location: A flat type "4"
Posts: 344
I use the TP700 recipe handling stored on sd card and a S7 1200. What complicates my system little over the limit is that we don't edit recipes (only) in the view but instead have parameter screens throughout the hmi. We also have some access level depending parameters...

So TP700 recipes works well for what's intended, but keeping it all in plc gives more control. And makes it easier to change hmi.

A notification of when a recipe parameter change is pending is tricky either way.
__________________
Jon Bolmstedt, Inspired Automatician.
  Reply With Quote
Old April 4th, 2018, 06:38 PM   #10
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,693
Thanks for all the tips. It looks like the HMI recipe option is out, because I'll need more than 5 recipes. But it sounds like the UDT and indirect addressing method is possible, so I guess I'll head down that path.

Can anyone help me out with a screenshot or article showing indirect addressing in TIA Portal? Most of the examples I've found online are in STL, and I'm kind of stuck with ladder by customer requirement.
  Reply With Quote
Old April 5th, 2018, 02:39 AM   #11
tarik1978
Member
Morocco

tarik1978 is offline
 
Join Date: Mar 2010
Location: casablanca
Posts: 399
This thread should help you
http://www.plctalk.net/qanda/showthread.php?t=104280
See also this link
https://support.industry.siemens.com...=0&pageSize=10

Last edited by tarik1978; April 5th, 2018 at 02:42 AM.
  Reply With Quote
Old April 5th, 2018, 10:59 AM   #12
mk42
Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 1,964
ASF,

You can pretty much follow the same steps as you laid out for AB-land, except that the Data type instance will probably be in a DB. In Portal (for recentish 1200s and 1500s), Indirect addressing is as easy as #Arrayname[#indextag], for Ladder, FBD, and SCL. For multiple dimensions, it would be [#index1,#index2,etc].

Two things to watch out for:

1) When you go to add the index inside the brackets, the only thing the dropdown will give you is the different defined indexes in the array (0-100, etc). It will NOT help you browse all the tags, like usual. I generally have to type out the desired tag somewhere else, validate it, and then copy/paste it in.

2) There are a few posts above with different solutions, but you'll need to make sure you consider retentivity. In the logix world, all tags are retentive. If you're thinking like a german, then you only want some memory to be retained, and the rest to be set back to a defined initial value after power up or a download that changes a DB.

A) the simplest solution is to mark your recipes as retentive, but if there is much size to your recipe system, then it probably won't fit.

B) Another option is to write the recipes to load memory via the Read/write_DBL instructions. This sets the start values of the DBs to the current values. However, if you need to change the DB later, the values may not get uploaded into your project.

C) A third option is to use some included instructions to write the recipes to the memory card as a CSV file, with the recipe instructions. This makes it easy to import recipes as well, and the CSV files are accessible over the web interface.

Regardless how you do it, be careful if you make any changes to the recipe data structure after you've filled in the records. It can be very easy for the live data to vanish in a puff of logic.
  Reply With Quote
Old April 5th, 2018, 12:40 PM   #13
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,048
2. If you write values to DB-block, they are all retentive by default, but download of DB will set them back to init values.
(with siemens you need offline -> online copy, and you have backup of parameters also on offline project)

This is case if you haven't selected optimatez block access.
With optimatez access you can select if seperate symbols are retentive or not.


Merker words (MW, MD, MF) are only retentive, if you config them from hardware to retentives.
  Reply With Quote
Old April 5th, 2018, 01:19 PM   #14
JOLTRON
Lifetime Supporting Member
United States

JOLTRON is offline
 
JOLTRON's Avatar
 
Join Date: Aug 2006
Location: MI
Posts: 650
Quote:
Originally Posted by Lare View Post
2. If you write values to DB-block, they are all retentive by default, but download of DB will set them back to init values.
(with siemens you need offline -> online copy, and you have backup of parameters also on offline project)

This is case if you haven't selected optimatez block access.
With optimatez access you can select if seperate symbols are retentive or not.


Merker words (MW, MD, MF) are only retentive, if you config them from hardware to retentives.
I believe in the 300's all DB's are retained by default, but I thought this changed in the 1200's and 1500's. I believe you have to check a box in the DB to specify what data you want retained.

Not sure how the M area works in the newer processors either. In the 300's I remember the HW config had an area where a default 16 bytes or so were defined as retentive.
  Reply With Quote
Old April 5th, 2018, 06:50 PM   #15
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,693
Quote:
Originally Posted by mk42 View Post
ASF,

You can pretty much follow the same steps as you laid out for AB-land, except that the Data type instance will probably be in a DB. In Portal (for recentish 1200s and 1500s), Indirect addressing is as easy as #Arrayname[#indextag], for Ladder, FBD, and SCL. For multiple dimensions, it would be [#index1,#index2,etc].

Two things to watch out for:

1) When you go to add the index inside the brackets, the only thing the dropdown will give you is the different defined indexes in the array (0-100, etc). It will NOT help you browse all the tags, like usual. I generally have to type out the desired tag somewhere else, validate it, and then copy/paste it in.
The same applies in AB-land, so no problems there.

Quote:
Originally Posted by mk42 View Post
2) There are a few posts above with different solutions, but you'll need to make sure you consider retentivity. In the logix world, all tags are retentive. If you're thinking like a german, then you only want some memory to be retained, and the rest to be set back to a defined initial value after power up or a download that changes a DB.
Ah, yes, the old non-retentive memory trick. I will be sure to watch out for this one.

Quote:
Originally Posted by mk42 View Post
A) the simplest solution is to mark your recipes as retentive, but if there is much size to your recipe system, then it probably won't fit.
My recipes only have about 8-10 parameters (one string and the rest integers), and there are only 10 recipes. So memory space is probably not an issue

Quote:
Originally Posted by mk42 View Post
B) Another option is to write the recipes to load memory via the Read/write_DBL instructions. This sets the start values of the DBs to the current values. However, if you need to change the DB later, the values may not get uploaded into your project.

C) A third option is to use some included instructions to write the recipes to the memory card as a CSV file, with the recipe instructions. This makes it easy to import recipes as well, and the CSV files are accessible over the web interface.

Regardless how you do it, be careful if you make any changes to the recipe data structure after you've filled in the records. It can be very easy for the live data to vanish in a puff of logic.
I'll keep those options in mind. It's been a while since I looked into TIA but I vaguely remember configuring some DB's to be retentive, so I'm sure it's doable. The system as it currently exists stores what will ultimately become the recipe settings in a DB, so obviously they're retentive - they don't have to re-enter all the parameters when they power cycle the machine. It's just a matter of me giving them multiple copies of those existing, already retentive settings.


Thanks a heap for the very thorough advice!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
run Step 7 without TIA Portal dmned64 LIVE PLC Questions And Answers 4 June 7th, 2017 06:39 AM
Siemens SIMATIC WinCC TIA Portal v14 - Is Indirect tagging Possible? DenZ_P LIVE PLC Questions And Answers 2 January 24th, 2017 06:51 AM
Indirect addressing in TIA Portal (1500) DairyBoy LIVE PLC Questions And Answers 8 July 18th, 2016 12:04 PM
TIA Portal V13 S71500 indirect addressing JOLTRON LIVE PLC Questions And Answers 0 March 26th, 2015 12:32 PM
Siemens OP77B Trouble in TIA Portal Tim James LIVE PLC Questions And Answers 4 December 24th, 2012 03:27 PM


All times are GMT -5. The time now is 10:13 PM.


.