libiec61850.NET
1.5.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 |
Public Member Functions | |
delegate void | ConnectionIndicationHandler (IedServer iedServer, ClientConnection clientConnection, bool connected, object parameter) |
void | SetConnectionIndicationHandler (ConnectionIndicationHandler 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 More... | |
void | Start (string localIpAddress, int tcpPort) |
Start MMS server More... | |
void | Start (int tcpPort) |
Start MMS server More... | |
void | Start () |
Start MMS server More... | |
void | Stop () |
Stop the MMS server. More... | |
void | Destroy () |
Release all server resources (same as Dispose) More... | |
void | Dispose () |
Releases all resource used by the IEC61850.Server.IedServer object. More... | |
void | SetServerIdentity (string vendor, string model, string revision) |
Set the identify for the MMS identify service More... | |
bool | IsRunning () |
Check if server is running (accepting client connections) More... | |
int | GetNumberOfOpenConnections () |
Get number of open MMS connections More... | |
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 More... | |
void | HandleWriteAccess (DataAttribute dataAttr, WriteAccessHandler handler, object parameter) |
Install a WriteAccessHandler for a data attribute. More... | |
void | HandleWriteAccessForComplexAttribute (DataAttribute dataAttr, WriteAccessHandler handler, object parameter) |
Install a WriteAccessHandler for a data attribute and for all sub data attributes More... | |
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 More... | |
void | LockDataModel () |
Locks the data model for data update. More... | |
void | UnlockDataModel () |
Unlocks the data model and process pending client requests. More... | |
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) |
void | EnableGoosePublishing () |
Enable all GOOSE control blocks. More... | |
void | DisableGoosePublishing () |
Disable all GOOSE control blocks. More... | |
void | SetGooseInterfaceId (string interfaceId) |
Set the Ethernet interface to be used by GOOSE publishing More... | |
void | SetGooseInterfaceId (LogicalNode ln, string gcbName, string interfaceId) |
Set the Ethernet interface to be used by GOOSE publishing More... | |
void | UseGooseVlanTag (LogicalNode ln, string gcbName, bool useVlanTag) |
Enable/disable the use of VLAN tags in GOOSE messages More... | |
void | SetGoCBHandler (GoCBEventHandler handler, object parameter) |
Set a callback handler for GoCB events (enabled/disabled) More... | |
void | SetRCBEventHandler (RCBEventHandler handler, object parameter) |
Set a callback handler for RCB events More... | |
This class acts as the entry point for the IEC 61850 client API. It represents a single (MMS) connection to a server.
void IEC61850.Server.IedServer.Destroy | ( | ) |
Release all server resources (same as Dispose)
This function releases all MMS server resources.
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.
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.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. |
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.
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 | ( | 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.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.SetLocalIpAddress | ( | string | localIpAddress | ) |
Sets the local ip address for listening
localIpAddress | Local IP address. |
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.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.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 | ( | string | localIpAddress, |
int | tcpPort | ||
) |
Start MMS server
localIpAddress | Local IP address. |
tcpPort | TCP port to use |
void IEC61850.Server.IedServer.Start | ( | int | tcpPort | ) |
Start MMS server
tcpPort | TCP port to use |
void IEC61850.Server.IedServer.Start | ( | ) |
Start MMS server
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.
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.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 |