Also in the TapedCountBackup tag data box I did TapedCountBackup=TapedCount and that produced an error?
One more time:
Put that in complex code, or just drag and drop the tag into the field for the other tag...
This, however, will not do what you want. Doing that will result in the tags always being identical. You want to preserve the greater of the two values (when it boils down to it):
I want the backup tag to retain the count when the main count tag is cleared. I only want the backup tag to clear when I do it my manual intervention?
You can't have the tag alter itself as part of its own definition. Crimson will give you an error "Circular reference"
So do this:
On the tag TapedCount, go to the triggers tab and add an action "Rise in Value". For Value put 1 (assuming we are dealing with an integer).
For the action, choose complex code and in the code window put:
if(TapedCount > TapedCountBackup) TapedCountBackup:=TapedCount;
This will cause TapedCountBackup to be set to the same value as TapedCount only if it is greater than Taped CountBackup. It will only execute when TapedCount changes, so it is quite efficient.
Now, if TapedCount should be I dunno let's say 15. And along comes whatever situation that causes it to reset to zero. Then it begins to increment again. TapedCountBackup will still have a value of 15 until TapedCount gets back up to 16, then TapedCountBackup will start following it again. If you want TapedCountBackup to just freeze whenever TapedCount gets set to zero, then we need to add more logic and another retentive flag tag to keep up with all that.
If you could explain the bigger picture...the why and what for behind this thing you're doing, we might be able to offer something entirely different and perhaps wholly better for your operation.
It is quite common for counts to be reset at shift change, product changeovers, daily, etc. Would it be nice to have a month's worth of data ie. daily counts for each product made? Maybe I'm reading too far into your application...
You say your machine resets the count when it loses power. Is there some reason you can't just fix that problem? And if you can't, do you maybe want to have the Red Lion go even further and stuff the known greater value back into the TapedCount Tag (write it back to the PLC)?