Examples of Using the AddData Function
This topic provides examples of using the AddData function.
Writing a Single Tag Value
The following example is used to write a single value, the current time, and a good quality value to a single tag.errs = AddData("Bucket Brigade.UInt4", 9, "Now", 100)
Writing an Array of Tags
The following example is used to write an array of tags and their values.Dim Tags(3)
Tags(0) = "Bucket Brigade.Boolean"
Tags(1) = "Bucket Brigade.Int4"
Tags(2) = "Bucket Brigade.Real8"
Tags(3) = "Bucket Brigade.String"
Dim Values(3)
Values(0) = True
Values(1) = 5
Values(2) = 172.3
Values(3) = "Hello, World"
errs = AddData(Tags, Values, Null, Null)
Writing Timestamps and Qualities
The following example is used to write an array of tags and their values in addition to timestamp and quality values.Dim Tags(3)
Tags(0) = "Bucket Brigade.Boolean"
Tags(1) = "Bucket Brigade.Int4"
Tags(2) = "Bucket Brigade.Real8"
Tags(3) = "Bucket Brigade.String"
Dim Values(3)
Values(0) = True
Values(1) = 5
Values(2) = 172.3
Values(3) = "Hello, World"
Dim Timestamps(3)
Timestamps(0) = "Today"
Timestamps(1) = "Now"
Timestamps(2) = "Yesterday"
Timestamps(3) = "24/12/2004 2:32:15 PM"
Dim Qualities(3)
Qualities(0) = 100
Qualities(1) = 0
Qualities(2) = 100
Qualities(3) = 0
Dim errs
errs = AddData(Tags, Values, Timestamps, Qualities)