libiec61850.NET 1.6.1
IEC 61850 .NET API for libiec61850 protocol library
|
This class acts as the entry point for the IEC 61850 client API. It represents a single (MMS) connection to a server. More...
Classes | |
class | ControlHandlerInfo |
class | SVCHandlerInfo |
Public Types | |
enum | IedServer_DirectoryCategory { DIRECTORY_CAT_LD_LIST , DIRECTORY_CAT_DATA_LIST , DIRECTORY_CAT_DATASET_LIST , DIRECTORY_CAT_LOG_LIST } |
Public Member Functions | |
delegate bool | IedServer_ListObjectsAccessHandler (IntPtr parameter, ClientConnection connection, ACSIClass acsiClass, LogicalDevice ld, LogicalNode ln, string objectName, string subObjectName, FunctionalConstraint fc) |
delegate void | ConnectionIndicationHandler (IedServer iedServer, ClientConnection clientConnection, bool connected, object parameter) |
void | SetConnectionIndicationHandler (ConnectionIndicationHandler handler, object parameter) |
void | SetListObjectsAccessHandler (IedServer_ListObjectsAccessHandler handler, IntPtr parameter) |
delegate bool | ControlBlockAccessHandler (object parameter, ClientConnection connection, ACSIClass acsiClass, LogicalDevice ld, LogicalNode ln, string objectName, string subObjectName, ControlBlockAccessType accessType) |
void | SetControlBlockAccessHandler (ControlBlockAccessHandler handler, object parameter) |
Set a handler to control read and write access to control blocks and logs. | |
delegate bool | DataSetAccessHandler (object parameter, ClientConnection connection, DataSetOperation operation, string datasetRef) |
void | SetDataSetAccessHandler (DataSetAccessHandler handler, object parameter) |
Callback that is called when the client is calling a dataset operation (create, delete, read, write, list directory) note This callback is called before the IedServer_RCBEventHandler and only in case of operations(RCB_EVENT_GET_PARAMETER, RCB_EVENT_SET_PARAMETER, RCB_EVENT_ENABLE. | |
delegate bool | ActiveSettingGroupChangedHandler (object parameter, SettingGroupControlBlock sgcb, uint newActSg, ClientConnection connection) |
void | SetActiveSettingGroupChangedHandler (ActiveSettingGroupChangedHandler handler, SettingGroupControlBlock settingGroupControlBlock, object parameter) |
int | GetActiveSettingGroupChangedHandler (SettingGroupControlBlock settingGroupControlBlock) |
delegate bool | EditSettingGroupChangedHandler (object parameter, SettingGroupControlBlock sgcb, uint newEditSg, ClientConnection connection) |
void | SetEditSettingGroupChangedHandler (EditSettingGroupChangedHandler handler, SettingGroupControlBlock settingGroupControlBlock, object parameter) |
delegate void | EditSettingGroupConfirmationHandler (object parameter, SettingGroupControlBlock sgcb, uint editSg) |
void | SetEditSettingGroupConfirmationHandler (EditSettingGroupConfirmationHandler handler, SettingGroupControlBlock settingGroupControlBlock, object parameter) |
delegate void | SVCBEventHandler (SVControlBlock sampledValuesControlBlock, SMVEvent sMVEvent, object parameter) |
void | SetSVCBHandler (SVCBEventHandler handler, SVControlBlock sampledValuesControlBlock, object parameter) |
delegate bool | AcseAuthenticatorHandler (object parameter, AcseAuthenticationParameter authParameter, object securityToken, IsoApplicationReference isoApplicationReference) |
void | SetAuthenticator (AcseAuthenticatorHandler acseAuthenticatorHandler, object acseAuthenticatorHandlerParameter) |
delegate MmsDataAccessError | ReadAccessHandler (LogicalDevice ld, LogicalNode ln, DataObject dataObject, FunctionalConstraint fc, ClientConnection connection, object parameter) |
void | SetReadAccessHandler (ReadAccessHandler handler, object parameter) |
delegate bool | DirectoryAccessHandler (object parameter, ClientConnection connection, IedServer_DirectoryCategory category, LogicalDevice ld) |
void | SetDirectoryAccessHandler (DirectoryAccessHandler handler, object parameter) |
IedServer (IedModel iedModel, IedServerConfig config=null) | |
IedServer (IedModel iedModel, TLSConfiguration tlsConfig, IedServerConfig config=null) | |
void | SetLocalIpAddress (string localIpAddress) |
Sets the local ip address for listening. | |
void | Start (string localIpAddress, int tcpPort) |
Start MMS server. | |
void | Start (int tcpPort) |
Start MMS server. | |
void | Start () |
Start MMS server. | |
void | Stop () |
Stop the MMS server. | |
void | Destroy () |
Release all server resources (same as Dispose) | |
void | Dispose () |
Releases all resource used by the IEC61850.Server.IedServer object. | |
void | SetServerIdentity (string vendor, string model, string revision) |
Set the identify for the MMS identify service. | |
bool | IsRunning () |
Check if server is running (accepting client connections) | |
int | GetNumberOfOpenConnections () |
Get number of open MMS connections. | |
void | SetControlHandler (DataObject controlObject, ControlHandler handler, object parameter) |
void | SetCheckHandler (DataObject controlObject, CheckHandler handler, object parameter) |
void | SetWaitForExecutionHandler (DataObject controlObject, ControlWaitForExecutionHandler handler, object parameter) |
void | SetSelectStateChangedHandler (DataObject controlObject, ControlSelectStateChangedHandler handler, object parameter) |
Set a callback handler for a controllable data object to track select state changes. | |
void | HandleWriteAccess (DataAttribute dataAttr, WriteAccessHandler handler, object parameter) |
Install a WriteAccessHandler for a data attribute. | |
void | HandleWriteAccessForComplexAttribute (DataAttribute dataAttr, WriteAccessHandler handler, object parameter) |
Install a WriteAccessHandler for a data attribute and for all sub data attributes. | |
void | HandleWriteAccessForDataObject (DataObject dataObj, FunctionalConstraint fc, WriteAccessHandler handler, object parameter) |
Install a WriteAccessHandler for a data object and for all sub data objects and sub data attributes that have the same functional constraint. | |
void | SetWriteAccessPolicy (FunctionalConstraint fc, AccessPolicy policy) |
Set the defualt write access policy for a specific FC. The default policy is applied when no handler is installed for a data attribute. | |
void | LockDataModel () |
Locks the data model for data update. | |
void | UnlockDataModel () |
Unlocks the data model and process pending client requests. | |
void | UpdateAttributeValue (DataAttribute dataAttr, MmsValue value) |
void | UpdateBooleanAttributeValue (DataAttribute dataAttr, bool value) |
void | UpdateFloatAttributeValue (DataAttribute dataAttr, float value) |
void | UpdateInt32AttributeValue (DataAttribute dataAttr, int value) |
void | UpdateInt64AttributeValue (DataAttribute dataAttr, Int64 value) |
void | UpdateVisibleStringAttributeValue (DataAttribute dataAttr, string value) |
void | UpdateUTCTimeAttributeValue (DataAttribute dataAttr, DateTime timestamp) |
void | UpdateTimestampAttributeValue (DataAttribute dataAttr, Timestamp timestamp) |
void | UpdateQuality (DataAttribute dataAttr, ushort value) |
MmsValue | GetAttributeValue (DataAttribute dataAttr) |
MmsValue | GetFunctionalConstrainedData (DataObject dataObject, FunctionalConstraint fc) |
Get the MmsValue object related to a functional constrained data object (FCD) | |
void | EnableGoosePublishing () |
Enable all GOOSE control blocks. | |
void | DisableGoosePublishing () |
Disable all GOOSE control blocks. | |
void | SetGooseInterfaceId (string interfaceId) |
Set the Ethernet interface to be used by GOOSE publishing. | |
void | SetGooseInterfaceId (LogicalNode ln, string gcbName, string interfaceId) |
Set the Ethernet interface to be used by GOOSE publishing. | |
void | UseGooseVlanTag (LogicalNode ln, string gcbName, bool useVlanTag) |
Enable/disable the use of VLAN tags in GOOSE messages. | |
void | SetGoCBHandler (GoCBEventHandler handler, object parameter) |
Set a callback handler for GoCB events (enabled/disabled) | |
void | SetRCBEventHandler (RCBEventHandler handler, object parameter) |
Set a callback handler for RCB events. | |
void | SetTimeQuality (bool leapSecondKnown, bool clockFailure, bool clockNotSynchronized, int subsecondPrecision) |
Set the time quality for all timestamps internally generated by this IedServer instance. | |
void | SetLogStorage (string logRef, LogStorage logStorage) |
This class acts as the entry point for the IEC 61850 client API. It represents a single (MMS) connection to a server.
IEC61850.Server.IedServer.IedServer | ( | IedModel | iedModel, |
IedServerConfig | config = null ) |
IEC61850.Server.IedServer.IedServer | ( | IedModel | iedModel, |
TLSConfiguration | tlsConfig, | ||
IedServerConfig | config = null ) |
delegate bool IEC61850.Server.IedServer.AcseAuthenticatorHandler | ( | object | parameter, |
AcseAuthenticationParameter | authParameter, | ||
object | securityToken, | ||
IsoApplicationReference | isoApplicationReference ) |
delegate bool IEC61850.Server.IedServer.ActiveSettingGroupChangedHandler | ( | object | parameter, |
SettingGroupControlBlock | sgcb, | ||
uint | newActSg, | ||
ClientConnection | connection ) |
delegate void IEC61850.Server.IedServer.ConnectionIndicationHandler | ( | IedServer | iedServer, |
ClientConnection | clientConnection, | ||
bool | connected, | ||
object | parameter ) |
delegate bool IEC61850.Server.IedServer.ControlBlockAccessHandler | ( | object | parameter, |
ClientConnection | connection, | ||
ACSIClass | acsiClass, | ||
LogicalDevice | ld, | ||
LogicalNode | ln, | ||
string | objectName, | ||
string | subObjectName, | ||
ControlBlockAccessType | accessType ) |
delegate bool IEC61850.Server.IedServer.DataSetAccessHandler | ( | object | parameter, |
ClientConnection | connection, | ||
DataSetOperation | operation, | ||
string | datasetRef ) |
void IEC61850.Server.IedServer.Destroy | ( | ) |
Release all server resources (same as Dispose)
This function releases all MMS server resources.
delegate bool IEC61850.Server.IedServer.DirectoryAccessHandler | ( | object | parameter, |
ClientConnection | connection, | ||
IedServer_DirectoryCategory | category, | ||
LogicalDevice | ld ) |
void IEC61850.Server.IedServer.DisableGoosePublishing | ( | ) |
void IEC61850.Server.IedServer.Dispose | ( | ) |
Releases all resource used by the IEC61850.Server.IedServer object.
Call Dispose when you are done using the IEC61850.Server.IedServer. The Dispose method leaves the IEC61850.Server.IedServer in an unusable state. After calling Dispose, you must release all references to the IEC61850.Server.IedServer so the garbage collector can reclaim the memory that the IEC61850.Server.IedServer was occupying.
delegate bool IEC61850.Server.IedServer.EditSettingGroupChangedHandler | ( | object | parameter, |
SettingGroupControlBlock | sgcb, | ||
uint | newEditSg, | ||
ClientConnection | connection ) |
delegate void IEC61850.Server.IedServer.EditSettingGroupConfirmationHandler | ( | object | parameter, |
SettingGroupControlBlock | sgcb, | ||
uint | editSg ) |
void IEC61850.Server.IedServer.EnableGoosePublishing | ( | ) |
Enable all GOOSE control blocks.
This will set the GoEna attribute of all configured GOOSE control blocks to true. If this method is not called at the startup or reset of the server then configured GOOSE control blocks keep inactive until a MMS client enables them by writing to the GOOSE control block.
int IEC61850.Server.IedServer.GetActiveSettingGroupChangedHandler | ( | SettingGroupControlBlock | settingGroupControlBlock | ) |
MmsValue IEC61850.Server.IedServer.GetAttributeValue | ( | DataAttribute | dataAttr | ) |
MmsValue IEC61850.Server.IedServer.GetFunctionalConstrainedData | ( | DataObject | dataObject, |
FunctionalConstraint | fc ) |
int IEC61850.Server.IedServer.GetNumberOfOpenConnections | ( | ) |
Get number of open MMS connections.
void IEC61850.Server.IedServer.HandleWriteAccess | ( | DataAttribute | dataAttr, |
WriteAccessHandler | handler, | ||
object | parameter ) |
Install a WriteAccessHandler for a data attribute.
This instructs the server to monitor write attempts by MMS clients to specific data attributes.If a client tries to write to the monitored data attribute the handler is invoked.The handler can decide if the write access will be allowed or denied.If a WriteAccessHandler is set for a specific data attribute - the default write access policy will not be performed for that data attribute.
NOTE: If the data attribute has sub data attributes, the WriteAccessHandler is not set for the sub data attributes and will not be called when the sub data attribute is written directly!
dataAttr | the data attribute to monitor |
handler | the callback function that is invoked if a client tries to write to the monitored data attribute. |
parameter | a user provided parameter that is passed to the WriteAccessHandler when called. |
void IEC61850.Server.IedServer.HandleWriteAccessForComplexAttribute | ( | DataAttribute | dataAttr, |
WriteAccessHandler | handler, | ||
object | parameter ) |
Install a WriteAccessHandler for a data attribute and for all sub data attributes.
This instructs the server to monitor write attempts by MMS clients to specific data attributes. If a client tries to write to the monitored data attribute the handler is invoked. The handler can decide if the write access will be allowed or denied.If a WriteAccessHandler is set for a specific data attribute - the default write access policy will not be performed for that data attribute.
NOTE: When the data attribute is a complex attribute then the handler will also be installed for all sub data attributes. When the data attribute is a basic data attribute then this function behaves like HandleWriteAccess.
dataAttr | the data attribute to monitor |
handler | the callback function that is invoked if a client tries to write to the monitored data attribute. |
parameter | a user provided parameter that is passed to the WriteAccessHandler when called. |
void IEC61850.Server.IedServer.HandleWriteAccessForDataObject | ( | DataObject | dataObj, |
FunctionalConstraint | fc, | ||
WriteAccessHandler | handler, | ||
object | parameter ) |
Install a WriteAccessHandler for a data object and for all sub data objects and sub data attributes that have the same functional constraint.
This instructs the server to monitor write attempts by MMS clients to specific data attributes. If a client tries to write to the monitored data attribute the handler is invoked. The handler can decide if the write access will be allowed or denied. If a WriteAccessHandler is set the default write access policy will not be performed for the matching data attributes.
dataObject | the data object to monitor |
fc | the functional constraint (FC) to monitor |
handler | the callback function that is invoked if a client tries to write to a monitored data attribute that is a child of the data object. |
parameter | a user provided parameter that is passed to the WriteAccessHandler when called. |
delegate bool IEC61850.Server.IedServer.IedServer_ListObjectsAccessHandler | ( | IntPtr | parameter, |
ClientConnection | connection, | ||
ACSIClass | acsiClass, | ||
LogicalDevice | ld, | ||
LogicalNode | ln, | ||
string | objectName, | ||
string | subObjectName, | ||
FunctionalConstraint | fc ) |
bool IEC61850.Server.IedServer.IsRunning | ( | ) |
Check if server is running (accepting client connections)
true
, if running, false
otherwise.void IEC61850.Server.IedServer.LockDataModel | ( | ) |
Locks the data model for data update.
This function should be called before the data model is updated. After updating the data model the function UnlockDataModel should be called.
his method should never be called inside of a library callback function. In the context of a library callback the data model is always already locked! Calling this function inside of a library callback may lead to a deadlock condition.
delegate MmsDataAccessError IEC61850.Server.IedServer.ReadAccessHandler | ( | LogicalDevice | ld, |
LogicalNode | ln, | ||
DataObject | dataObject, | ||
FunctionalConstraint | fc, | ||
ClientConnection | connection, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetActiveSettingGroupChangedHandler | ( | ActiveSettingGroupChangedHandler | handler, |
SettingGroupControlBlock | settingGroupControlBlock, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetAuthenticator | ( | AcseAuthenticatorHandler | acseAuthenticatorHandler, |
object | acseAuthenticatorHandlerParameter ) |
void IEC61850.Server.IedServer.SetCheckHandler | ( | DataObject | controlObject, |
CheckHandler | handler, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetConnectionIndicationHandler | ( | ConnectionIndicationHandler | handler, |
object | parameter ) |
void IEC61850.Server.IedServer.SetControlBlockAccessHandler | ( | ControlBlockAccessHandler | handler, |
object | parameter ) |
Set a handler to control read and write access to control blocks and logs.
handler | the callback handler to be used |
parameter | a user provided parameter that is passed to the handler |
void IEC61850.Server.IedServer.SetControlHandler | ( | DataObject | controlObject, |
ControlHandler | handler, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetDataSetAccessHandler | ( | DataSetAccessHandler | handler, |
object | parameter ) |
Callback that is called when the client is calling a dataset operation (create, delete, read, write, list directory) note This callback is called before the IedServer_RCBEventHandler and only in case of operations(RCB_EVENT_GET_PARAMETER, RCB_EVENT_SET_PARAMETER, RCB_EVENT_ENABLE.
handler | the callback handler to be used |
parameter | a user provided parameter that is passed to the handler |
void IEC61850.Server.IedServer.SetDirectoryAccessHandler | ( | DirectoryAccessHandler | handler, |
object | parameter ) |
void IEC61850.Server.IedServer.SetEditSettingGroupChangedHandler | ( | EditSettingGroupChangedHandler | handler, |
SettingGroupControlBlock | settingGroupControlBlock, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetEditSettingGroupConfirmationHandler | ( | EditSettingGroupConfirmationHandler | handler, |
SettingGroupControlBlock | settingGroupControlBlock, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetGoCBHandler | ( | GoCBEventHandler | handler, |
object | parameter ) |
Set a callback handler for GoCB events (enabled/disabled)
handler | the callback handler |
parameter | user provided parameter that is passed to the callback handler |
void IEC61850.Server.IedServer.SetGooseInterfaceId | ( | LogicalNode | ln, |
string | gcbName, | ||
string | interfaceId ) |
Set the Ethernet interface to be used by GOOSE publishing.
This function can be used to set the GOOSE interface ID for all GCBs (parameter ln = null) or for a specific GCB specified by the logical node instance and the GCB name.
ln | ln the logical node that contains the GCB or null to set the ethernet interface ID for all GCBs |
gcbName | the name (not object reference!) of the GCB |
interfaceId | the ID of the ethernet interface to be used for GOOSE publishing |
void IEC61850.Server.IedServer.SetGooseInterfaceId | ( | string | interfaceId | ) |
Set the Ethernet interface to be used by GOOSE publishing.
This function can be used to set the GOOSE interface ID. If not used or set to null the default interface ID from stack_config.h is used.Note the interface ID is operating system specific!
interfaceId | the ID of the ethernet interface to be used for GOOSE publishing |
void IEC61850.Server.IedServer.SetListObjectsAccessHandler | ( | IedServer_ListObjectsAccessHandler | handler, |
IntPtr | parameter ) |
void IEC61850.Server.IedServer.SetLocalIpAddress | ( | string | localIpAddress | ) |
Sets the local ip address for listening.
localIpAddress | Local IP address. |
void IEC61850.Server.IedServer.SetLogStorage | ( | string | logRef, |
LogStorage | logStorage ) |
void IEC61850.Server.IedServer.SetRCBEventHandler | ( | RCBEventHandler | handler, |
object | parameter ) |
Set a callback handler for RCB events.
handler | the callback handler |
parameter | user provided parameter that is passed to the callback handler |
void IEC61850.Server.IedServer.SetReadAccessHandler | ( | ReadAccessHandler | handler, |
object | parameter ) |
void IEC61850.Server.IedServer.SetSelectStateChangedHandler | ( | DataObject | controlObject, |
ControlSelectStateChangedHandler | handler, | ||
object | parameter ) |
Set a callback handler for a controllable data object to track select state changes.
controlObject | Control object. |
handler | Handler. |
parameter | A user provided parameter that is passed to the callback handler. |
void IEC61850.Server.IedServer.SetServerIdentity | ( | string | vendor, |
string | model, | ||
string | revision ) |
Set the identify for the MMS identify service.
vendor | the IED vendor name |
model | the IED model name |
revision | the IED revision/version number |
void IEC61850.Server.IedServer.SetSVCBHandler | ( | SVCBEventHandler | handler, |
SVControlBlock | sampledValuesControlBlock, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetTimeQuality | ( | bool | leapSecondKnown, |
bool | clockFailure, | ||
bool | clockNotSynchronized, | ||
int | subsecondPrecision ) |
Set the time quality for all timestamps internally generated by this IedServer instance.
leapSecondKnown | set/unset leap seconds known flag |
clockFailure | set/unset clock failure flag |
clockNotSynchronized | set/unset clock not synchronized flag |
subsecondPrecision | set the subsecond precision (number of significant bits of the fractionOfSecond part of the time stamp) |
void IEC61850.Server.IedServer.SetWaitForExecutionHandler | ( | DataObject | controlObject, |
ControlWaitForExecutionHandler | handler, | ||
object | parameter ) |
void IEC61850.Server.IedServer.SetWriteAccessPolicy | ( | FunctionalConstraint | fc, |
AccessPolicy | policy ) |
Set the defualt write access policy for a specific FC. The default policy is applied when no handler is installed for a data attribute.
fc | The functional constraint (FC) |
policy | The new default access policy |
void IEC61850.Server.IedServer.Start | ( | ) |
Start MMS server.
void IEC61850.Server.IedServer.Start | ( | int | tcpPort | ) |
Start MMS server.
tcpPort | TCP port to use |
void IEC61850.Server.IedServer.Start | ( | string | localIpAddress, |
int | tcpPort ) |
Start MMS server.
localIpAddress | Local IP address. |
tcpPort | TCP port to use |
void IEC61850.Server.IedServer.Stop | ( | ) |
Stop the MMS server.
This function will stop the server. This will close the TCP server socket and all client sockets.
delegate void IEC61850.Server.IedServer.SVCBEventHandler | ( | SVControlBlock | sampledValuesControlBlock, |
SMVEvent | sMVEvent, | ||
object | parameter ) |
void IEC61850.Server.IedServer.UnlockDataModel | ( | ) |
Unlocks the data model and process pending client requests.
This method should never be called inside of a library callback function. In the context of a library callback the data model is always already locked!
void IEC61850.Server.IedServer.UpdateAttributeValue | ( | DataAttribute | dataAttr, |
MmsValue | value ) |
void IEC61850.Server.IedServer.UpdateBooleanAttributeValue | ( | DataAttribute | dataAttr, |
bool | value ) |
void IEC61850.Server.IedServer.UpdateFloatAttributeValue | ( | DataAttribute | dataAttr, |
float | value ) |
void IEC61850.Server.IedServer.UpdateInt32AttributeValue | ( | DataAttribute | dataAttr, |
int | value ) |
void IEC61850.Server.IedServer.UpdateInt64AttributeValue | ( | DataAttribute | dataAttr, |
Int64 | value ) |
void IEC61850.Server.IedServer.UpdateQuality | ( | DataAttribute | dataAttr, |
ushort | value ) |
void IEC61850.Server.IedServer.UpdateTimestampAttributeValue | ( | DataAttribute | dataAttr, |
Timestamp | timestamp ) |
void IEC61850.Server.IedServer.UpdateUTCTimeAttributeValue | ( | DataAttribute | dataAttr, |
DateTime | timestamp ) |
void IEC61850.Server.IedServer.UpdateVisibleStringAttributeValue | ( | DataAttribute | dataAttr, |
string | value ) |
void IEC61850.Server.IedServer.UseGooseVlanTag | ( | LogicalNode | ln, |
string | gcbName, | ||
bool | useVlanTag ) |
Enable/disable the use of VLAN tags in GOOSE messages.
This function can be used to enable/disable VLAN tagging for all GCBs (parameter ln = null) or for a specific GCB specified by the logical node instance and the GCB name.
ln | the logical node that contains the GCB or null to enable/disable VLAN tagging for all GCBs |
gcbName | the name (not object reference!) of the GCB |
useVlanTag | true to enable VLAN tagging, false otherwise |