Previous | Table of Contents | Next |
//File: DAISDAIO.idl#ifndef _DAIS_DAIO_IDL#define _DAIS_DAIO_IDL#pragma prefix "omg.org"#include <DAISCommon.idl>
module DAIS {
module DataAccess {module IO {
enum DataSource { DS_CACHE, DS_DEVICE
};
struct ItemState
{ SimpleValue value; DateTime time_stamp; Quality dais_quality; ClientItemHandle client_handle;
};typedef sequence<ItemState> ItemStates;
struct ItemUpdate
{ ServerItemHandle server_handle; SimpleValue value;
};typedef sequence<ItemUpdate> ItemUpdates;
interface SyncIO{
ItemStates sync_read ( in DataSource data_source, in ServerItemHandles server_handles, out ItemErrors errors
);
ItemErrors sync_write (
in);};typedeint{ |
ItemUpdates updates |
||||
f unsi | gned long | CancelID; | |||
erface AsyncIO | |||||
exception NotConnected{string reason;}; exception InvalidCancelID{string reason;}; exception NotActive{string reason;};
CancelID async_read ( in ServerItemHandles server_handles, in DataSource data_source, in unsigned long transaction_id
) raises (NotConnected, NotActive);
CancelID async_write ( in ItemUpdates updates,
in unsigned long transaction_id ) raises (NotConnected);
CancelID refresh (
in DataSource data_source, ) raises (NotConnected,NotActive);
void cancel ( in CancelID cancel_id in unsigned long transaction_id
) raises (InvalidCancelID);
attribute boolean enabled; };
interface Callback {
void on_data_change ( in unsigned long transaction_id, in boolean all_quality_good, in ItemStates states
);
void on_read_complete ( in unsigned long transaction_id, in boolean all_quality_good, in ItemStates states, in ItemErrors
errors
);
void on_write_complete ( in unsigned long transaction_id, in ItemErrors errors
);
void on_cancel_complete (
in | unsigned long | transaction_id | |||
); | |||||
}; |
interface ConnectionPoint {
attribute Callback cllbck; };};};}; #endif // _DAIS_DAIO_IDL DataSource
Member | Description | ||||
DS_CACHE | Data cached in the server is requested. | ||||
DS_DEVICE | Data from the device is requested. This will force a read from the device or RTU. A read from device will be made regardless of the group or item active status and no group NotActive exception will be forced. |
ItemState
The struct is the major carrier of data conveyed over the interface. It is the “message? holding the payload.
Member | Description | ||||
value | The value itself. | ||||
time_stamp | The time stamp when the value was last updated. | ||||
quality | The quality for the value. | ||||
client_handle | A client side handle enabling the client to make a quick look up of the item in its internal data structures. |
ItemUpdate
The struct carry an update for an item.
Member | Description | ||||
server_handle | A server side handle enabling the server to make a quick look up of the item in its internal data structures. | ||||
value | The value that shall be used in the update. |
SyncIO
An interface for the synchronous operations.
sync_read()
Synchronous read of items. Inactive items will be reported with OPCQuality set to OPC_QUALITY_OUT_OF_SERVICE.
Parameter | Description | ||||
data_source | The source from where to read the data. | ||||
server_handles | A sequence specifying the whole or a subset of the server side handles as defined via the DAIS::GroupEntry::Manager interface. | ||||
errors | A sequence reporting items for which the read failed. An empty sequence indicates all read operations succeeded. Reported errors are: • ERROR_BAD_RIGHTS (item is write only) • INVALID_DAIS_HANDLE | ||||
return | A sequence of ItemStates for the items. |
sync_write()
Synchronous write of item values to devices (not the internal server cache). The active state of the group or the items is
ignored.
Parameter | Description | ||||
updates | A sequence of ItemUpdates specifying all or a subset of the items defined for a GroupEntry::Manager. The ItemUpdate::value member is used to update the items in devices. | ||||
return | A sequence reporting items for which the write failed. An empty sequence indicates write operations for all items succeeded. Reported errors are: • ERROR_BAD_RIGHTS (item is read only) • ERROR_INVALID_DAIS_HANDLE • ERROR_CLAMPED • ERROR_OUT_OF_RANGE • ERROR_BAD_TYPE |
AsyncIO
An interface for asynchronous read or write operations.
NotConnected
An exception telling that there is no callback object connected by the client.
InvalidCancelID
An exception telling that the supplied cancel id number is not recognized.
NotActive
An exception telling that the group or all items in the group is inactive. Only issued when read from cache.
async_read()
Asynchronous read of items from devices. OPC may report read errors both at return from async_read() and at on_read_complete().
DAIS will report all errors at on_read_complete()..
Parameter | Description | ||||
server_handles | A sequence specifying the whole or a subset of the server side handles, as defined via the DAIS::GroupEntry::Manager interface. | ||||
data_source | The source from where to read the data. When reading from cache, inactive items will be reported with OPCQuality set to OPC_QUALITY_OUT_OF_SERVICE. | ||||
transaction_id | A transaction number unique for the client. The number is returned in the corresponding on_read_complete call. | ||||
return | A cancellation number unique for the client. The number is used by a client to cancel an ongoing asynchronous read operation. |
async_write()
Asynchronous write of item values to devices (not the internal server cache). OPC may report write errors both at return from
async_write() and at on_write_complete(). DAIS will report all errors at on_write_complete().
Parameter | Description | ||||
updates | A sequence of ItemUpdates specifying all or a subset of the items defined for a DAIS::GroupEntry::Manager. The ItemUpdate::value member is used to update the items in devices. | ||||
transaction_id | A transaction number unique for the client. The number is returned in the corresponding on_read_complete call. | ||||
return | A cancellation number unique for the client. The number is used by a client to cancel an ongoing asynchronous write operation. |
refresh()
Initiate a complete asynchronous read transfer for all item entries defined via the DAIS::DataAccess::GroupEntry::Manager
interface. Inactive items will be reported with OPCQuality set to OPC_QUALITY_OUT_OF_SERVICE.
The cyclic on_data_change reporting continues unaffected by a refresh call. However, items still unchanged after a refresh
will not be reported in a succeeding on_data_change call.
Parameter | Description | ||||
data_source | The source from where to read the data. | ||||
transaction_id | A transaction number unique for the client. The number is returned in the corresponding on_data_change call. | ||||
return | A cancellation number unique for the client. The number is used by a client to cancel an ongoing asynchronous refresh operation. |
cancel()
Cancel on ongoing refresh, async read, or async write operations. The server is expected to acknowledge a successfully initiated
cancel operation with an on_cancel_complete() callback.
Parameter | Description | ||||
cancel_id | The server generated cancellation number for the operation | ||||
to cancel. |
enable
An attribute used to enable or disable the spontaneous on_data_change() callbacks. The enable state does not affect on data
change response to refresh calls. When a group is created it is enabled by default.
Callback
An interface implemented by the client and used by the server to send data to the client.
on_data_change()
The method is called by the server when spontaneous changes occur or when the client has requested an explicit refresh. Only
active items are reported in spontaneous calls.
Parameter | Description | ||||
transaction_id | If the call is in response to a refresh, the transaction number for that refresh call. If the call is autonomous due to one or more spontaneous changes, the number is zero. | ||||
all_quality_good | All item quality values are good. | ||||
item_states | A sequence of requested or spontaneously changed ItemStates. |
on_read_complete()
The method is used by the server to report data in response to an asynchronous read.
Parameter | Description | ||||
transaction_id | The transaction number for the corresponding read. | ||||
all_quality_good | All item quality values are good. This requires that no errors are reported in the error parameter below. | ||||
item_states | A sequence of ItemStates matching the read operation. | ||||
errors | A sequence reporting items for which the read failed. An empty sequence indicates all read operations initially succeeded. Reported errors are: • ERROR_BAD_RIGHTS (item is write only) • ERROR_INVALID_DAIS_HANDLE |
on_write_complete()
The method is used to report the success of an asynchronous write operation.
Parameter | Description | ||||
transaction_id | The transaction number for the corresponding write. | ||||
errors | A sequence reporting items for which the write failed. An empty sequence indicates all write operations initially succeeded. Reported errors are: • ERROR_BAD_RIGHTS (item is read only) • ERROR_INVALID_DAIS_HANDLE • ERROR_CLAMPED • ERROR_OUT_OF_RANGE • ERROR_BAD_TYPE |
on_cancel_complete()
The method is used to acknowledge the completion of a successfully initiated cancel call.
ConnectionPoint
An interface used by the client to connect or disconnect a client callback object at the server.
callback
An attribute referencing the callback object.
In an implementation one get and one set method will implement the callback attribute. Due to limitation in the UML tool used
to draw the diagrams, the attribute is represented by the two methods connect and disconnect.