Technical Forum

STEP 7 (TIA Portal)

Data block and tag

Thread Starter: Per Olof   Started: 5/26/2011 5:03 PM   Replies: 11

« Previous thread Next thread »
12» Page 1 of 2 (12 items)
  5/26/2011, 5:03 PM
Joined 5/8/2010
Last visit: 9/15/2014
Posts: 293
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello,

I do not have hardware to test this on so I hope anybody could help me ...

The PLC tag variables do they get cleared at a power off ?

If I want to keep values I should declare them in a data block an tick the box retain ?

Cheers Per Olof
Top
  5/26/2011, 5:21 PM
Joined 7/7/2010
Last visit: 9/17/2014
Posts: 3190
Rating:
Rated: Outstanding [4 out of 5 / rated 359 time(s)]. (359) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Per Olof wrote:
Hello,

I do not have hardware to test this on so I hope anybody could help me ...

The PLC tag variables do they get cleared at a power off ?

If I want to keep values I should declare them in a data block an tick the box retain ?

Cheers Per Olof


This is for TIA Portal 10.5 SP2.

You can retain PLC tag variables.  You will want to create a retained DB and on first scan set your PLC tags using your retained DB (and have the last OB's last bit of logic save those special PLC tag values to your retained DB.

You can only choose an entire DB to retain values.  I stumbled across something that allowed finer control over retained values, but cannot reproduce it.  Maybe in V11 the options are better for retaining values of PLC tags.

Otherwise, they are set to 0 when the PLC starts.

Helpful? Rate it.
Solved? Post it.
http://geo.co/s/EyRK
Top
  5/26/2011, 5:31 PM
Joined 5/8/2010
Last visit: 9/15/2014
Posts: 293
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Thanks huggy_d1 for your quick respons!

But why not use the variables declared in the DB direct ? Why to copy to PLC tags ?
Top
  5/26/2011, 6:35 PM
Joined 3/14/2008
Last visit: 8/10/2014
Posts: 111
Rating:
Rated: Excellent [4.07 out of 5 / rated 14 time(s)]. (14) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
When you create a datablock using symbolic memory you can select individual items as retentive memory. If the data block is Classic then only the complete datablock can be made to be retentive.So with Classic it is all or nothing.

Hope that helps.
John
Top
  5/26/2011, 9:03 PM
Joined 7/7/2010
Last visit: 9/17/2014
Posts: 3190
Rating:
Rated: Outstanding [4 out of 5 / rated 359 time(s)]. (359) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
bakerjw wrote:
When you create a datablock using symbolic memory you can select individual items as retentive memory. If the data block is Classic then only the complete datablock can be made to be retentive.So with Classic it is all or nothing.

Hope that helps.
John

Ahh, that's what I discovered but didn't realize how I got there!  Thanks for the explanation.

As to the question, I'd probably prefer to use DBs rather than PLC tags for most everything, but it's tougher to quickly create DB bits, bytes, words, etc. than it is to create PLC tags.  For those tags you need to use with retentive values, I have a DB, Retained_DB, which is set to retain all of its values. 

It works well as a reminder.  When a new retained value is needed, add it to the DB.  That way, retained data is minimized.

Helpful? Rate it.
Solved? Post it.
http://geo.co/s/EyRK
Top
  5/27/2011, 9:30 PM
Joined 5/8/2010
Last visit: 9/15/2014
Posts: 293
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Thanks for the answers! However I notice that I can not use the MOVE block to move one DB tag  to another DB tag ?

How to move a DB value ? to a tag ? to another DB value ?

Cheers Per Olof
Top
  5/29/2011, 9:48 PM
Joined 7/24/2008
Last visit: 9/16/2014
Posts: 2492
Rating:
Rated: Excellent [4.32 out of 5 / rated 438 time(s)]. (438) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,

first, you can set as retain memory variables: in the "Tags list" there is a "battery/key" buttom that enable the retain property.

Second, to better understood your problem, write us witch variables type do you have. Do you work with Struct / arrays of the same type/size?

Denilson Pegaia
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040
E-Mail: atencao.cliente.ac.br@siemens.com
Top
  5/31/2011, 3:58 PM
Joined 5/8/2010
Last visit: 9/15/2014
Posts: 293
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello Pegaia,

I would like to retain values when the power is switched off. I cretaed a data block and a few int values within the data block and ticked the box to retain the values.

In the code I would like to move one int value within the data block to another int value in the data block, but the move instruction does not support variables within a data block. One solution I hope works is to use the mul instruction (and to mul with 1) to move values instead.

Cheers Per Olof
Top
  5/31/2011, 5:44 PM
Joined 7/24/2008
Last visit: 9/16/2014
Posts: 2492
Rating:
Rated: Excellent [4.32 out of 5 / rated 438 time(s)]. (438) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,

I can't understood, why do you don't could move values from / to DB.
Can you send us a printscreen of your tentative?

Denilson Pegaia
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040
E-Mail: atencao.cliente.ac.br@siemens.com
Top
  5/31/2011, 8:24 PM
Joined 7/7/2010
Last visit: 9/17/2014
Posts: 3190
Rating:
Rated: Outstanding [4 out of 5 / rated 359 time(s)]. (359) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
If the MOVE doesn't work, try CONV.

I just created a MOVE using two UINTs within the same DB (using 10.5 SP2) and it worked fine.  Pegaia is right in saying it should work!

Helpful? Rate it.
Solved? Post it.
http://geo.co/s/EyRK
Top
12» Page 1 of 2 (12 items)
Actions