SetAttributeVT2()
- Last UpdatedJan 02, 2018
- 1 minute read
Sets the value and timestamp of an object attribute. This function is identical to SetAttributeVT(), but SetAttributeVT2() allows interim calculated data for buffered values to be historized once per scan cycle.
Category
Miscellaneous
Syntax
SetAttributeVT2( Attribute, Value, TimeStamp);
Parameter
Attribute
Name of the object attribute whose value and timestamp are modified. The specified attribute must belong to the object to which the script is attached.
Value
Value of the attribute, which can be a reference. The quality is always set to Good.
TimeStamp
Timestamp that can be a reference, a variable, or a string interpreted as the computer’s local time or UTC. The timestamp is converted internally to UTC format before the attribute’s value is sent to the run-time component.
Remarks
In contrast to SetAttributeVT(), SetAttributeVT2() allows historization of interim calculated buffered values.
Timestamp can be set only for object attributes that support a timestamp. At compile time, the script cannot detect whether the attribute specified with the SetAttributeVT2() function supports a timestamp or not. No warning is issued if the attribute does not support a timestamp.
Example
This example sets an integer value and timestamp for an attribute that indicates pump RPM (interim calculated values for buffered data are historized).
SetAttributeVT2(me.PV, TC104.PumpRPM, LCLTIME);