libiec61850.NET  1.5.1
IEC 61850 .NET API for libiec61850 protocol library
IEC61850.Server.IedServer Class Reference

This class acts as the entry point for the IEC 61850 client API. It represents a single (MMS) connection to a server. More...

Inheritance diagram for IEC61850.Server.IedServer:
Collaboration diagram for IEC61850.Server.IedServer:

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...
 

Detailed Description

This class acts as the entry point for the IEC 61850 client API. It represents a single (MMS) connection to a server.

Member Function Documentation

◆ Destroy()

void IEC61850.Server.IedServer.Destroy ( )

Release all server resources (same as Dispose)

This function releases all MMS server resources.

◆ DisableGoosePublishing()

void IEC61850.Server.IedServer.DisableGoosePublishing ( )

Disable all GOOSE control blocks.

This will set the GoEna attribute of all configured GOOSE control blocks to false. This will stop GOOSE transmission.

◆ Dispose()

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.

◆ EnableGoosePublishing()

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.

◆ GetNumberOfOpenConnections()

int IEC61850.Server.IedServer.GetNumberOfOpenConnections ( )

Get number of open MMS connections

Returns
the number of open and accepted MMS connections

◆ HandleWriteAccess()

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!

Parameters
dataAttrthe data attribute to monitor
handlerthe callback function that is invoked if a client tries to write to the monitored data attribute.
parametera user provided parameter that is passed to the WriteAccessHandler when called.

◆ HandleWriteAccessForComplexAttribute()

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.

Parameters
dataAttrthe data attribute to monitor
handlerthe callback function that is invoked if a client tries to write to the monitored data attribute.
parametera user provided parameter that is passed to the WriteAccessHandler when called.

◆ IsRunning()

bool IEC61850.Server.IedServer.IsRunning ( )

Check if server is running (accepting client connections)

Returns
true, if running, false otherwise.

◆ LockDataModel()

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.

◆ SetGoCBHandler()

void IEC61850.Server.IedServer.SetGoCBHandler ( GoCBEventHandler  handler,
object  parameter 
)

Set a callback handler for GoCB events (enabled/disabled)

Parameters
handlerthe callback handler
parameteruser provided parameter that is passed to the callback handler

◆ SetGooseInterfaceId() [1/2]

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!

Parameters
interfaceIdthe ID of the ethernet interface to be used for GOOSE publishing

◆ SetGooseInterfaceId() [2/2]

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.

Parameters
lnln the logical node that contains the GCB or null to set the ethernet interface ID for all GCBs
gcbNamethe name (not object reference!) of the GCB
interfaceIdthe ID of the ethernet interface to be used for GOOSE publishing

◆ SetLocalIpAddress()

void IEC61850.Server.IedServer.SetLocalIpAddress ( string  localIpAddress)

Sets the local ip address for listening

Parameters
localIpAddressLocal IP address.

◆ SetRCBEventHandler()

void IEC61850.Server.IedServer.SetRCBEventHandler ( RCBEventHandler  handler,
object  parameter 
)

Set a callback handler for RCB events

Parameters
handlerthe callback handler
parameteruser provided parameter that is passed to the callback handler

◆ SetSelectStateChangedHandler()

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

Parameters
controlObjectControl object.
handlerHandler.
parameterA user provided parameter that is passed to the callback handler.

◆ SetServerIdentity()

void IEC61850.Server.IedServer.SetServerIdentity ( string  vendor,
string  model,
string  revision 
)

Set the identify for the MMS identify service

Parameters
vendorthe IED vendor name
modelthe IED model name
revisionthe IED revision/version number

◆ SetWriteAccessPolicy()

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

Parameters
fcThe functional constraint (FC)
policyThe new default access policy

◆ Start() [1/3]

void IEC61850.Server.IedServer.Start ( string  localIpAddress,
int  tcpPort 
)

Start MMS server

Parameters
localIpAddressLocal IP address.
tcpPortTCP port to use

◆ Start() [2/3]

void IEC61850.Server.IedServer.Start ( int  tcpPort)

Start MMS server

Parameters
tcpPortTCP port to use

◆ Start() [3/3]

void IEC61850.Server.IedServer.Start ( )

Start MMS server

◆ Stop()

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.

◆ UnlockDataModel()

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!

◆ UseGooseVlanTag()

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.

Parameters
lnthe logical node that contains the GCB or null to enable/disable VLAN tagging for all GCBs
gcbNamethe name (not object reference!) of the GCB
useVlanTagtrue to enable VLAN tagging, false otherwise

The documentation for this class was generated from the following file: