AVEVA OMI Software Developer Kit
Value, Timestamp, Quality and Status

VTQ

The VTQ class represents the value, timestamp, and quality status of the data item. The data item is also called the IData Reference.

VTQ
Copy Code
    public abstract class VTQ
    {
        /// <summary>
        /// Gets the value of the data item.
        /// </summary>
        public abstract DataValue Value { get; }
        /// <summary>
        /// Gets the quality and status of the data item.
        /// </summary>
        public abstract QualityStatus QualityStatus { get; }
        /// <summary>
        /// Gets the time stamp represented in UTC.
        /// </summary>
        public abstract DateTime Timestamp { get; }
    }

Value

Value represents the value of the data item value and related data conversion utility methods.

Value
Copy Code
public class Value
    {
        /// <summary>
        /// Gets or sets the raw data value contained in this class.
        /// </summary>
        public abstract object RawValue { get; }
        /// <summary>
        /// Gets the value as type Integer.
        /// </summary>
        public abstract int ValueAsInt32 { get; }
        /// <summary>
        /// Gets the value as type Float.
        /// </summary>
        public abstract float ValueAsFloat { get; }
        /// <summary>
        /// Gets the value as type Double.
        /// </summary>
        public abstract double ValueAsDouble { get; }
        /// <summary>
        /// Gets the value as type String.
        /// </summary>
        public abstract string ValueAsString { get; }
        /// <summary>
        /// Gets the value as type DateTime.
        /// </summary>
        public abstract DateTime ValueAsDateTime { get; }
        /// <summary>
        /// Gets the value as type Duration.
        /// </summary>
        public abstract TimeSpan ValueAsDuration { get; }
        /// <summary>
        /// Gets the value as type bool.
        /// </summary>
        /// <value><c>true</c> if [value as bool]; otherwise, <c>false</c>.</value>
        public abstract bool ValueAsBool { get; }
        /// <summary>
        /// Gets a value indicating whether this instance is empty
        /// </summary>
        /// <value><c>true</c> if this instance is empty; otherwise, <c>false</c>.</value>
        public abstract bool IsEmpty { get; }

        /// <summary>
        /// Gets a value indicating whether the value is an array.
        /// </summary>
        /// <value><c>true</c> if this instance is array; otherwise, <c>false</c>.</value>
        public abstract bool IsArray { get; }
        /// <summary>
        /// Gets the array value if the value is holding an array.
        /// </summary>
        /// <returns></returns>
        public abstract Array Array { get; }
        /// <summary>
        /// Gets the number of elements in the array if the value is holding array data.
        /// </summary>
        /// <returns>The number of elements in the array.</returns>
        public abstract int ArraySize { get; }
        /// <summary>
        /// If the value is holding an array, this returns an element from the array.
        /// </summary>
        /// <param name="elementIndex">value of elementindex</param>
        /// <returns>object value</returns>
        public abstract object GetArrayElement(int elementIndex);
    }

QualityStatus

The QualityStatus class represents the data quality and status, and related helper methods.

QualityStatus
Copy Code
    public abstract class QualityStatus
    {
        /// <summary>
        /// This defines the bits when the quality does not exist.
        /// </summary>
        public const int QualityNotExist = -1;
        /// <summary>
        /// Gets the status setting enum.
        /// </summary>
        public abstract StatusSettingType StatusSetting { get; }
        /// <summary>
        /// The data quality follows OPC UA standard, or QualityNotExist if it does not exist.
        /// </summary>
        public abstract int OpcUaQuality { get; }
       
        /// <summary>
        /// The data quality used by ArchestrA, or QualityNotExist if it does not exist.
        /// </summary>
        public abstract int MxQuality { get; }

        /// <summary>
        /// Returns true if the quality is good.
        /// </summary>
        /// <returns>True if good</returns>
        public abstract bool IsGood();

        /// <summary>
        /// Returns true if the quality is bad.
        /// </summary>
        /// <returns>True if bad</returns>
        public abstract bool IsBad();
        /// <summary>
        /// Returns true if the quality is uncertain.
        /// </summary>
        /// <returns>True if uncertain</returns>
        public abstract bool IsUncertain();
        /// <summary>
        /// Returns true if the quality is initializing.
        /// </summary>
        /// <returns>True if initializing</returns>
        public abstract bool IsInitializing();
    }

StatusSettingType

The StatusSettingType enumeration represents the data status settings used in the Galaxy style library configuration.

StatusSettingType
Copy Code
    public enum StatusSettingType : byte
    {
        /// <summary>
        /// Represents a Communication Error type.
        /// </summary>
        Communication = 0,
        /// <summary>
        /// Represents a Configuration Error type.
        /// </summary>
        Configuration = 1,
        /// <summary>
        ///  Represents a Pending Error type.
        /// </summary>
        Pending = 2,
        /// <summary>
        ///  Represents an Operational Error type.
        /// </summary>
        Operational = 3,
        /// <summary>
        ///  Represents a Software Error type.
        /// </summary>
        Software = 4,
        /// <summary>
        ///  Represents a Security Error type
        /// </summary>
        Security = 5,
        /// <summary>
        ///  Represents a Warning Error type.
        /// </summary>
        Warning = 6,
        /// <summary>
        ///  Represents Out Of Service.
        /// </summary>
        OutOfService = 7,
        /// <summary>
        ///  Represents a Device Failure.
        /// </summary>
        DeviceFailure = 8,
        /// <summary>
        ///  Represents a Bad Error type.
        /// </summary>
        Bad = 9,
        /// <summary>
        ///  Represents an Uncertain Error type.
        /// </summary>
        Uncertain = 10,
        /// <summary>
        ///  Represents an Initializing Error type.
        /// </summary>
        Initializing = 11,
        /// <summary>
        ///  Represents Good status.
        /// </summary>
        Good = 12,
        /// <summary>
        ///  Represents an Unknown type.
        /// </summary>
        Unknown = 13
    }