AVEVA OMI Software Developer Kit
Read and Write Status

DataSubscription

Use the DataSubscription class from IRuntimeDataClient to read and data.

DataSubscription
Copy Code
    public abstract class DataSubscription
    {
        /// <summary>
        /// Read the runtime data asynchronously.
        /// </summary>
        /// <param name="dataReferenceSources">The data reference source
        ///  array</param>
        /// <returns>The VTQ array of the references</returns>
        public abstract Task<VTQ[]> ReadAsync(DataReferenceSource[] dataReferenceSources);
        /// <summary>
        /// Write the runtime data asynchronously.
        /// When writing to an ArchestrA attribute in which security is
        /// SecuredWrite or VerifiedWrite, the corresponding pop-up dialog box    
        /// will automatically popup and the method will return when the dialog
        /// box is dismissed and the data is either written to the source or fails.
        /// </summary>
        /// <param name="dataReferenceSource">The data reference source</param>
        /// <param name="value">The value to be written</param>
        /// <returns>The status of the write operation</returns>
        public abstract Task<WriteOperationStatus> WriteAsync(DataReferenceSource dataReferenceSource , object value);
        /// <summary>
        /// Subscribe the runtime data references.
        /// </summary>
        /// <param name="dataReferenceSources">The data reference source array</param>
        /// <returns>The subscribed data reference array</returns>
        public abstract DataReference[] Subscribe(DataReferenceSource[] dataReferenceSources);
        /// <summary>
        /// Unsubscribe the runtime data references.
        /// </summary>
        /// <param name="dataReferences">The data reference array</param>
        public abstract void Unsubscribe(DataReference[] dataReferences);
        /// <summary>
        /// Unsubscribe all runtime data references.
        /// </summary>
        public abstract void UnsubscribeAll();
    }

WriteOperationStatus

Use the WriteOperationStatus class to receive write status when writing data to a reference.

WriteOperationStatus
Copy Code
    public enum WriteOperationStatus
    {
        /// <summary>
        /// Indicates success
        /// </summary>
        WriteSuccess = 0,
        /// <summary>
        /// Indicates failure
        /// </summary>
        WriteFailed = 1,
        /// <summary>
        /// Indicates failure because of application authentication issues
        /// </summary>
        ApplicationAuthenticationError = 2,
        /// <summary>
        /// Indicates failure because of user authentication issues
        /// </summary>
        UserAuthenticationError = 3,
        /// <summary>
        /// Indicates failure because of user authorization issues
        /// </summary>
        UserAuthorizationError = 4,
        /// <summary>
        /// Indicates failure because of unsupported operation
        /// </summary>
        NotSupportedOperation = 5,
        /// <summary>
        /// Indicates failure because the item is already deleted
        /// </summary>
        ItemAlreadyDeletedOrDoesNotExist = 9,
        /// <summary>
        /// Indicates failure because the item is invalid
        /// </summary>
        InvalidMonitoredItems = 10,
        /// <summary>
        /// Indicates failure because the operation failed
        /// </summary>
        OperationFailed = 11,
        /// <summary>
        /// Indicates failure because of no connection
        /// </summary>
        WriteFailedNoConnection = 12
    }