atomic_robo

Retained tags

4 posts in this topic

Hello,

Can you please explain what a retained tag is? I thought it's a tag that retains its value after power loss. But when I created tags with initial values and then turned off the plc, they 'retained' their values even though they weren't configured to be 'retained'. And, how do we change the values in a retained tag?

Thank you in advance 

 

Share this post


Link to post
Share on other sites
4 hours ago, atomic_robo said:

Can you please explain what a retained tag is? I thought it's a tag that retains its value after power loss.

This is correct.

4 hours ago, atomic_robo said:

But when I created tags with initial values and then turned off the plc, they 'retained' their values even though they weren't configured to be 'retained'.

I just tested this myself. My values were reset to '0'. How did you write your test values? If you populate the 'Initial Value' field then this value will be written on power up.

4 hours ago, atomic_robo said:

And, how do we change the values in a retained tag?

There are many ways. It depends on your application. Typically a retained tag will be a variable setting for your application. Example would be a speed setting for a VFD or a temperature setting. Typically they would be written to from an HMI. If the 'Initial Value' field is blank and there is no PLC code writing to this variable then the last setting value will be retained after power loss.

Share this post


Link to post
Share on other sites

That answers my question. Thank you @IO_Rack

I was populating the retained tags in the initial value field. Then I noticed when I changed the value, the plc wouldn't take it. 

 

Share this post


Link to post
Share on other sites

The PLC will take it just fine.  Initial values are only sent at power-up.  It's not preventing you from changing it, unless you also check the 'Constant' box.

And if you change the value and it's set to retain, that value is held instead of the initial value.  Initial value would only be used on a retained variable if you force it to upon download or when the retained values are lost, such as dead battery.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now