Using the AddData Function to Write Data to an Arbitrary Tag

The Calculation Collector supports writing data to an arbitrary tag in the Historian archive through the AddData function. This function is used in a calculation formula to write values, errors, time stamps and qualities of one or more tags to the Historian archive.

The syntax of the AddData function is as follows:

errs = AddData(TagNames, Values, Timestamps, Qualities)

All parameters are required. TagNames can be either a single tag name, or an array of tag names in double quotes. Values can be a single value, or an array of values matched to an array of tag names. Only one value can be passed for each tag name. String values entered into the Values parameter must be enclosed in double quotes (for example, "value"). If you do not want to pass a value to the Timestamp or Quality parameter, replace the value with NULL.

Tip: If the TimeStamp parameter is left empty (for example, errs = AddData ("FIX.Sine", 33, null,100), the current time will be used as a timestamp.