Previous Table of Contents Next


3.1.5 DAISCommon IDL


   // File: DAISCommon.idl#ifndef _DAIS_COMMON_IDL#define _DAIS_COMMON_IDL#pragma prefix "omg.org"#include <DAFDescriptions.idl>module DAIS{typedef unsigned short SupportedFunctions;const SuportedFunctions DAIS_DATA_ACCESS =0x0001;const SupportedFunctions DAIS_ALARMS_AND_EVENTS =0x0002;

   typedef DAFDescriptions::ResourceID ResourceID;typedef DAFDescriptions::SimpleValueType SimpleValueType;typedef DAFDescriptions::SimpleValue SimpleValue;typedef DAFDescriptions::DateTime DateTime;typedef DAFDescriptions::PropertyID PropertyID;typedef DAFDescriptions::PropertyValueSequence PropertyValues;

   // sequences of resource idstypedef sequence<ResourceID> ResourceIDs;typedef sequence<PropertyID> PropertyIDs;

   truct ItemID{ResourceID resource;PropertyID property;};typedef sequence<ItemID> ItemIDs;

   typedef unsigned long ClientItemHandle;typedef sequence<ClientItemHandle> ClientItemHandles;typedef unsigned long long ServerItemHandle;typedef sequence<ServerItemHandle> ServerItemHandles;

   typedef short ServerItemIdentificationType;const ServerItemIdentificationType ITEM_ID = 0;const ServerItemIdentificationType PATH_NAME = 1;

   union ServerItemIdentification switch( ServerItemIdentificationType )

{

case ITEM_ID: ItemID item;
case PATH_NAME: string pathname;
};

   typedef sequence<ServerItemIdentification>ServerItemIdentifications;

   typedef unsigned short Error; struct ItemError {

   Error err;

   ClientItemHandle client_handle;

   ServerItemHandle server_handle;

   string pathname;

   string reason; }; typedef sequence<ItemError> ItemErrors;

   // error codes const Error ERROR_DAISOK = 0; const Error ERROR_BAD_RIGHTS = 1; const Error ERROR_UNKNOWN_ITEMID = 2; const Error ERROR_CLAMPED = 3; const Error ERROR_OUT_OF_RANGE = 4; const Error ERROR_UNKNOWN_PATHNAME = 5; const Error ERROR_BAD_TYPE = 6; const Error ERROR_UNKNOWN_ACCESS_PATH = 7; const Error ERROR_INTERNAL_SERVER = 8; const Error ERROR_INVALID_DAIS_HANDLE = 9;

   enum AccessRights {

   READABLE, WRITEABLE,

   READ_AND_WRITEABLE };

   typedef unsigned long OPCQuality; typedef unsigned long UserQuality;

   struct Quality {

   OPCQuality opc_quality;

   UserQuality user_quality; };

   // Masks for extracting quality subfields// (note 'status' mask also includes 'Quality' bits)

   const OPCQuality OPC_QUALITY_MASK = 0x000000C0; const OPCQuality OPC_STATUS_MASK = 0x000000FC; const OPCQuality OPC_LIMIT_MASK = 0x00000003;

   // Values for QUALITY_MASK bit field

   const OPCQualityOPC_QUALITY_BAD = 0x00000000; const OPCQuality OPC_QUALITY_UNCERTAIN = 0x00000040; const OPCQualityOPC_QUALITY_GOOD = 0x000000C0;

   // STATUS_MASK Values for Quality = BAD

   const OPCQuality OPC_QUALITY_CONFIG_ERROR = 0x00000004; const OPCQuality OPC_QUALITY_NOT_CONNECTED = 0x00000008; const OPCQuality OPC_QUALITY_DEVICE_FAILURE = 0x0000000C; const OPCQuality OPC_QUALITY_SENSOR_FAILURE = 0x00000010; const OPCQuality OPC_QUALITY_LAST_KNOWN = 0x00000014; const OPCQuality OPC_QUALITY_COMM_FAILURE = 0x00000018; const OPCQuality OPC_QUALITY_OUT_OF_SERVICE = 0x0000001C;

   // STATUS_MASK Values for Quality = UNCERTAIN

   const OPCQuality OPC_QUALITY_LAST_USABLE = 0x00000044; const OPCQuality OPC_QUALITY_SENSOR_CAL = 0x00000050; const OPCQuality OPC_QUALITY_EGU_EXCEEDED = 0x00000054; const OPCQuality OPC_QUALITY_SUB_NORMAL = 0x00000058; const OPCQuality DAIS_QUALITY_OCILLATORY = 0x0000005C;

   // STATUS_MASK Values for Quality = GOOD

   //const OPCQuality OPC_QUALITY_LOCAL_OVERRIDE= 0xD8; //use EXQ_Source_xxx instead of OPC_QUALITY_LOCAL_OVERRIDE

   // Values for Limit Bitfield

   const OPCQualityOPC_LIMIT_OK = 0x00000000; const OPCQualityOPC_LIMIT_LOW = 0x00000001; const OPCQualityOPC_LIMIT_HIGH = 0x00000002; const OPCQualityOPC_LIMIT_CONST = 0x00000003;

   //DAIS Quality extension masks

   const OPCQuality EXQ_SOURCE_MASK = 0x00000700;const OPCQuality EXQ_TEST_MASK = 0x00000800;const OPCQuality EXQ_OPERATOR_BLOCKED_MASK = 0x00001000;const OPCQuality EXQ_TIMESTAMP_ACCURACY_MASK = 0x00006000;

   //DAIS Quality source extensionconst OPCQuality EXQ_SOURCE_NONE = 0x00000000;const OPCQuality EXQ_SOURCE_PROCESS = 0x00000100;const OPCQuality EXQ_SOURCE_PRIMARY_SUBSTITUTED = 0x00000200;const OPCQuality EXQ_SOURCE_INHERITED_SUBSTITUTED= 0x00000300;const OPCQuality EXQ_SOURCE_CORRECTED = 0x00000400;const OPCQuality EXQ_SOURCE_DEFAULTED = 0x00000500;

   //DAIS Time stamp accuracyconst OPCQuality EXQ_TS_ACC_10_MSEC = 0x00000000;const OPCQuality EXQ_TS_ACC_100_MSEC = 0x00002000;const OPCQuality EXQ_TS_ACC_SECOND = 0x00004000;const OPCQuality EXQ_TS_ACC_BAD_TIME = 0x00006000;};#endif // _DAIS_COMMON_IDL

   SupportedFunctions

   This constant tells what functions the DAIS server (i.e., Data access, Alarms & Events, or both) supports. In case the server is extended with other functions they are included as well (e.g., Historical Data functionality (HDAIS)).

   DAF declarations

   These declarations (for example, ResourceID) import DAF declarations to DAIS.

   ItemID

   A pair of a ResourceID and a PropertyID. It uniquely identifies an item; that is, a property at a node.

Member

Description

resource The ResourceID.
property The PropertyID.

   ClientItemHandle

   A client created numeric handle used by the client to efficiently identify data coming from the server in callbacks.

   ServerItemHandle

   A server created numeric handle used by the server to efficiently identify items in client calls.

   ServerItemIdentification

   A union that holds either an ItemID or a pathname. Either can be used for identification of an item.

   Error

   Numeric error codes that are returned by ItemError.

EnumValue Description
ERROR_DAISOK Used to indicate an error free result.
ERROR_BAD_RIGHTS The Items AccessRights do not allow the operation.
ERROR_UNKNOWN_ITEMID The resource or property in the ItemID is unknown.
ERROR_CLAMPED A value passed to WRITE was accepted but the output was clamped.
ERROR_OUT_OF_RANGE The value was out of range.
ERROR_UNKNOWN_PATHNAME The pathname was not recognised.
ERROR_BAD_TYPE The server cannot convert the data between the specified format/ requested data type and the canonical data type.
ERROR_UNKNOWN_ACCESS_PATH The item's access path is unknown.
ERROR_INTERNAL_SERVER An error has appeared in the server due to some server internal problem.
ERROR_INVALID_DAIS_HANDLE A client or server handle was invalid.

   ItemError

   A struct for reporting of item related errors.

Member Description
err An error code as described below.
client_handle The client side handle identifying the item.
server_handle The server side handle identifying the item.
pathname The pathname for display or presentation purposes.
reason An additional text explaining the error.

   AccessRights

   Numeric access rights supported per item.

EnumValue

Description

READABLE Read only data.
WRITEABLE Write only data.
READ_AND_WRITABLE Both read and write data.

   OPCQuality

   A flag word giving the OPC quality. Each flag has a specific meaning as described below. Four groups of flags exist:

   Quality, status, and limit bit masks

Mask

Description

OPC_QUALITY_MASK Bit mask for main quality.
OPC_STATUS_MASK Bit mask for detailed quality.
OPC_LIMIT_MASK Bit mask for the limits.

   Main quality enumeration numbers

Enum

Description

OPC_QUALITY_BAD The number for bad quality.
OPC_QUALITY_UNCERTAIN The number for uncertain quality.
OPC_QUALITY_GOOD The number for good quality.

   After application of the OPC_QUALITY_MASK the quality shall be compared directly to the enumeration numbers to decide the quality.

   Detailed quality flags for bad quality

Flag Description
OPC_QUALITY_CONFIG_ERROR There is a server configuration error concerning this value.
OPC_QUALITY_NOT_CONNECTED The source of the value is not connected.
OPC_QUALITY_DEVICE_FAILURE A device failure has been detected.
OPC_QUALITY_SENSOR_FAILURE A sensor failure has been detected.
OPC_QUALITY_LAST_KNOWN The updating has stopped but there is an old value available.
OPC_QUALITY_COMM_FAILURE Communication has failed and no value available.
OPC_QUALITY_OUT_OF_SERVICE The updating of the value is manually blocked for update (the item is not active).

   Detailed quality flags for uncertain quality

Flag Description
OPC_QUALITY_LAST_USABLE The value is old. The time stamp gives the age.
OPC_QUALITY_EGU_EXCEEDED The value is beyond the capability of representation (for example, counter overflow).
OPC_QUALITY_SENSOR_CAL The sensor calibration is bad.
OPC_QUALITY_SUB_NORMAL Value is derived from multiple sources where the majority has less than required good quality.
DAIS_QUALITY_OCILLATORY If a binary value changes cyclically with a frequency higher than a specific threshold, it is oscillating. This quality compliant with IEC 61850-7-3.

   Definition of limit flags

Flag Description
OPC_LIMIT_OK The value is not limited; that is, it moves freely up or down.
OPC_LIMIT_LOW The value is stuck at a low limit.


   DAIS Quality extension masks

   The part of the flag word giving the DAIS extended quality. Each flag has a specific meaning as described below. These quality definitions are based on the revised IEC 61850-7-3 definitions of quality. The following masks are defined.

Mask Description
EXQ_SOURCE_MASK Bit mask for the source.
EXQ_TEST_MASK Bit mask for the test status. The test status indicates that the value is generated by a test and shall not be regarded as an operational value.
EXQ_OPERATOR_BLOCKED_MASK Bit mask for the operator blocked status. The status indicates that the value has been blocked for update and is old. The OPC_QUALITY_LAST_USABLE quality shall be set as well.
EXQ_TIMESTAMP_ACCURACY_MASK Bit mask for the time stamp accuracy.

   Flags defining source

Flag Description
EXQ_SOURCE_NONE There is no source for this data item. The code is used for spare items not yet allocated.
EXQ_SOURCE_PROCESS The source for this value is the process.
EXQ__SOURCE_PRIMARY_ SUBSTITUTED The value is manually substituted.
EXQ_SOURCE_INHERITED_ SUBSTITUTED A substituted value has been copied or used as input to some calculation. The result value is then marked with EXQ_SOURCE_INHERITED_ SUBSTITUTED.
EXQ_SOURCE_CORRECTED An alternate and more accurate value has been calculated by some application (e.g., a State Estimator). If this value has been used to correct the original value, it shall be indicated EXQ_SOURCE_CORRECTED.
EXQ_REMOTE_DEFAULTED The value is initialized by a default value.

   Flags defining time stamp quality

Flag Description
EXQ_LOCAL_NONEEXQ_TS_ACC_ 10_MSEC The value is not updated locally (i.e., it has a remote source specification). The flags (=0) indicate that the accuracy is 10 milliseconds or better (IEC61850-7-2 performance class T0).
EXQ_LOCAL_SUBSTITUTEDEXQ_TS_ ACC_100_MSEC The value is locally substituted (manually). The flags (=1) indicate that the accuracy is 100 milliseconds or better.
EXQ_LOCAL_SE_REPLACEDEXQ_TS_ ACC_SECOND The value is locally substituted by State Estimator. The flags (=2) indicate that the accuracy is in the range of seconds or better.
EXQ_TS_ACC_BAD_TIME The flags (=3) indicate that the time stamp is bad.

   QualityThe DAIS quality consists of OPCQuality and ExtendedQuality.

Member Description
opc_quality The quality as specified by OPC including extensions from DAIS.
user_quality A user specific quality.