uForte OPC Server Development Kit

Overview       Manual       License       Download       Feedback       News&Events
 Products
 Download
 Buy
 About OPC
 Login
 
 
"uForte OPC Server Development Kit" is a fine product, it has been extremely successful in the implementations we have used it in Coating Control and Mill Control."
Ned Scopulovic, Senior Systems Engineer at Hatch IAS
 

Manual

Back to the content

Programmatic Interface: IufOPCSvrCustMgr

IufOPCSvrCustMgr is an interface provided to client applications (Custom OPC Server, CCM, CCM Demo) to modify/control/customize the OPC server.
It's the main interface to perform all the essential functions on OPC objects like OPC Items, Conditions, Attributes etc.
Custom OPC Server receives also another interface to execute specific functions.
In all the examples this interface is used.

    /// <summary>
    /// Managed interface to control the OPC Server.
    /// </summary>
    public interface IufOPCSvrCustMgr
    {
        /// <summary>
        /// The event is fired when OPC clients write into OPC items.
        /// </summary>
        event ItemWriteDelegate OnItemWrite;

        /// <summary>
        /// The event is fired when OPC clients acknowledge conditions.
        /// </summary>
        event ConditionAckedDelegate OnConditionAcked;

        /// <summary>
        /// Add OPC item to the address space.
        /// </summary>
        /// <param name="itemId">OPC item id.</param>
        /// <param name="canonicalType">Item value type.</param>
        /// <param name="value">Initial value, can be null.</param>
        /// <param name="quality">Value quality.</param>
        /// <param name="readable">True - the item can be read by OPC clients; false - otherwise.</param>
        /// <param name="writeable">True - the item can be written by OPC clients; false - otherwise.</param>
        /// <param name="scanRateMs">A hint to the OPC clients of how often the item value can be changed.</param>
        /// <param name="archive">True - save item values in the database and make them available to HDA OPC clients; false - don't save item values.</param>
        void AddItem(string itemId, VarEnum canonicalType, object value, QualityEnum quality, bool readable,
            bool writeable, int scanRateMs, bool archive);

        /// <summary>
        /// Returns all OPC AE conditions currently exist on the server.
        /// </summary>
        /// <returns>Conditions</returns>
        IEnumerable<OpcCondition> GetAllConditions();

        /// <summary>
        /// Returns all OPC items currently exist on the server.
        /// </summary>
        /// <returns>OPC item ids</returns>
        IEnumerable<string> GetAllItems();

        /// <summary>
        /// Returns condition specified by source and condition name.
        /// </summary>
        /// <param name="source">Condition source.</param>
        /// <param name="conditionName">Condition name.</param>
        /// <returns>OPC condition.</returns>
        /// <exception cref="ArgumentException">The condition doesn't exist.</exception>
        OpcCondition GetCondition(string source, string conditionName);

        /// <summary>
        /// Get OPC item value, quality and time.
        /// </summary>
        /// <param name="itemId">OPC item id.</param>
        /// <returns>OPC item.</returns>
        OpcItem GetItem(string itemId);

        /// <summary>
        /// Removes all conditions currently exist on the server.
        /// </summary>
        void RemoveAllConditions();

        /// <summary>
        /// Removes all OPC items currently exist on the server.
        /// </summary>
        void RemoveAllItems();

        /// <summary>
        /// Removes the condition specified by the parameters.
        /// </summary>
        /// <param name="source">Condition source.</param>
        /// <param name="conditionName">Condition name.</param>
        /// <returns>True - the condition was removed; false - no condition was removed because it wasn't found.</returns>
        bool RemoveCondition(string source, string conditionName);

        /// <summary>
        /// Removes OPC item from the server.
        /// </summary>
        /// <param name="itemId">OPC item id.</param>
        /// <returns>True - the OPC item was removed; false - no OPC item was removed because it wasn't found.</returns>
        bool RemoveItem(string itemId);

        /// <summary>
        /// Generates a simple OPC AE event associated with no condition.
        /// </summary>
        /// <param name="source">Event source.</param>
        /// <param name="time">Time of the event.</param>
        /// <param name="message">Event message.</param>
        /// <param name="severity">Event severity from 1 to 1000 inclusive as the allowable range.</param>
        /// <param name="category">Event category which must be one of the following:
        ///   5 - Device Failure;
        ///   6 - Batch Status;
        ///   0 - System Message.
        /// </param>
        void SendEvent(string source, DateTime time, string message, int severity, int category);

        /// <summary>
        /// Set condition (update existing) or create new.
        /// </summary>
        /// <param name="condition">OPC condition.</param>
        /// <param name="ackRequired">True - OPC clients are required to acknowledge the condition change, e.g. when the condition becomes active; 
        /// false - no acknowledgement required</param>
        /// <returns>True - an existing condition was updated; false - new condition was created.</returns>
        bool SetCondition(OpcCondition condition, bool ackRequired);

        /// <summary>
        /// Set condition active flag.
        /// </summary>
        /// <param name="source">Condition source.</param>
        /// <param name="conditionName">Condition name.</param>
        /// <param name="active">True - activate condition; false - deactivate condition.</param>
        /// <param name="ackRequired">True - OPC clients are required to acknowledge the condition change, e.g. when the condition becomes active; 
        /// false - no acknowledgement required</param>
        /// <exception cref="ArgumentException">The condition doesn't exist.</exception>
        void SetCondition(string source, string conditionName, bool active, bool ackRequired);

        /// <summary>
        /// Set OPC item value.
        /// The value quality will be set to GOOD.
        /// </summary>
        /// <param name="itemId">OPC item id.</param>
        /// <param name="value">New item value which must be compatible with (convertible to) the canonical data type.</param>
        /// <exception cref="COMException">ErrorCode=0xC004000B - value is incompatbile with the item canonical type.
        /// ErrorCode=0xC0040008 - the OPC item doesn't exist.</exception>
        /// <exception cref="ArgumentException">itemId is null.</exception>
        void UpdateItem(string itemId, object value);

        /// <summary>
        /// Set OPC item value and quality.
        /// </summary>
        /// <param name="itemId">OPC item id.</param>
        /// <param name="value">New item value which must be compatible with (convertible to) the canonical data type.</param>
        /// <param name="quality">OPC item value quality.</param>
        /// <exception cref="COMException">ErrorCode=0xC004000B - value is incompatbile with the item canonical type.
        /// ErrorCode=0xC0040008 - the OPC item doesn't exist.</exception>
        /// <exception cref="ArgumentException">itemId is null.</exception>
        void UpdateItem(string itemId, object value, QualityEnum quality);

        /// <summary>
        /// Set OPC item value, quality and time.
        /// </summary>
        /// <param name="itemId">OPC item id.</param>
        /// <param name="value">New item value which must be compatible with (convertible to) the canonical data type.</param>
        /// <param name="quality">OPC item value quality.</param>
        /// <param name="time">Time when the new value was set to the item.</param>
        /// <exception cref="COMException">ErrorCode=0xC004000B - value is incompatbile with the item canonical type.
        /// ErrorCode=0xC0040008 - the OPC item doesn't exist.</exception>
        /// <exception cref="ArgumentException">itemId is null.</exception>
        void UpdateItem(string itemId, object value, QualityEnum quality, DateTime time);

        /// <summary>
        /// Returns condition attributes by category.
        /// </summary>
        /// <param name="category">condition category</param>
        /// <returns>attributes</returns>
        IEnumerable<OpcConditionAttributeDef> GetConditionAttributes(uint category);

        /// <summary>
        /// Updates condition attributes.
        /// </summary>
        /// <param name="category">condition category</param>
        /// <param name="attributes">attributes</param>
        void SetConditionAttributes(uint category, IEnumerable<OpcConditionAttributeDef> attributes);

        /// <summary>
        /// Returns number of currently connected clients by each interface type.
        /// </summary>
        /// <returns>OpcClientsState</returns>
        OpcClientsState GetConnectedClients();

        /// <summary>
        /// Removes all the item values in the HDA database and in the cache.
        /// </summary>
        void ClearHdaHistory();
    }
Copyright © uForte Co 2003-2017