Manual Tag Update

I’m using memory tags to store values that are updated manually through a form. For example, say I have a tag for water pressure. A technician reads a manual gauge and enters the value on a form. When he submits the form, the value is written to the tag. The purpose is to use simple tags (and the tag historian) as an easy way of storing timestamp+value information for manually recorded data.

My problem is that any time the entered value matches the current value of the tag, the tag isn’t updated (the LastChanged timestamp doesn’t change), and the new data point isn’t stored in the tag history. I’ve changed the deadband to zero, but that doesn’t seem to help.

I’m sure I’ve just got a scanclass or something configured wrong, but is there any way to do this?

If you want to force the Historian to record a new value every time the scan class executes you can either set the Max time between records to 1 Executions or set the Historical Deadband to -1, but it doesn’t sound like that’s what you’re looking for.

Try using the system.tag.storeTagHistory function, that should give you what you are looking for.

Thanks, Pat!

Yeah…storeTagHistory works; unfortunately, it doesn’t update the current value of the tag. I guess I’ll have to:
[ul]
[li]> Check if the new value is the same as the current[/li]
[li]> If it is, call both writeTag and storeTagHistory[/li]
[li]> If not, call only writeTag to prevent duplicate values in the historian[/li][/ul]

Not pretty, but it works.

Or, you could turn off the history on the tag and just use one function to write the new value to the tag with system.tag.write and store the value in the history with system.tag.storeTagHistory.