libiec61850.NET 1.6.1
IEC 61850 .NET API for libiec61850 protocol library
Loading...
Searching...
No Matches
IEC61850.Client.IedConnection 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.Client.IedConnection:

Public Member Functions

delegate void ConnectionClosedHandler (IedConnection connection)
 Called when the connection is closed.
 
delegate void StateChangedHandler (IedConnection connection, IedConnectionState newState)
 Called when there is a change in the connection state.
 
 IedConnection ()
 Initializes a new instance of the IEC61850.Client.IedConnection class.
 
 IedConnection (TLSConfiguration tlsConfig)
 Initializes a new instance of the IEC61850.Client.IedConnection class.
 
void Dispose ()
 Releases all resource used by the IEC61850.Client.IedConnection object.
 
IsoConnectionParameters GetConnectionParameters ()
 Gets the connection parameters.
 
void SetMaxOutstandingCalls (int calling, int called)
 Set the maximum number outstanding calls allowed for this connection.
 
void SetTimeQuality (bool leapSecondKnown, bool clockFailure, bool clockNotSynchronized, int subsecondPrecision)
 Set the time quality for all timestamps generated by this IedConnection instance.
 
MmsConnection GetMmsConnection ()
 Gets the underlying MmsConnection instance.
 
void Connect (string hostname, int tcpPort)
 Establish an MMS connection to a server.
 
void ConnectAsync (string hostname, int tcpPort)
 
IedConnectionState GetState ()
 Gets the current state of the connection.
 
void Connect (string hostname)
 Establish an MMS connection to a server.
 
void SetLocalAddress (string localIpAddress, int localPort)
 Set the local IP address and port to be used by the client.
 
void SetLocalAddress (string localIpAddress)
 Set the local IP address to be used by the client.
 
ControlObject CreateControlObject (string objectReference)
 
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

 
SampledValuesControlBlock GetSvControlBlock (string svcbObjectReference)
 Creates a new SampledValuesControlBlock instance.
 
GooseControlBlock GetGooseControlBlock (string gocbObjectReference)
 Creates a new SampledValuesControlBlock instance.
 
void UpdateDeviceModel ()
 Updates the device model by quering the server.
 
List< string > GetServerDirectory (bool fileDirectory=false)
 Gets the server directory (Logical devices or file objects)
 
List< string > GetLogicalDeviceDirectory (string logicalDeviceName)
 
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

 
List< string > GetLogicalNodeDirectory (string logicalNodeName, ACSIClass acsiClass)
 Get the directory of a logical node (LN)
 
List< string > GetDataDirectory (string dataReference)
 Get a list of attributes (with functional constraints) of a DO, SDO, or DA.
 
List< string > GetDataDirectory (string dataReference, FunctionalConstraint fc)
 Get the list of attributes with the specified FC of a DO, SDO, or DA.
 
List< string > GetDataDirectoryFC (string dataReference)
 Get a list of attributes (with functional constraints) of a DO, SDO, or DA.
 
List< MmsJournalEntryQueryLogAfter (string logRef, byte[] entryID, ulong timestamp, out bool moreFollows)
 Queries all log entries after the entry with the given entryID and timestamp.
 
List< MmsJournalEntryQueryLogByTime (string logRef, ulong startTime, ulong stopTime, out bool moreFollows)
 Queries all log entries of the given time range.
 
List< MmsJournalEntryQueryLogByTime (string logRef, DateTime startTime, DateTime stopTime, out bool moreFollows)
 Queries all log entries of the given time range.
 
MmsVariableSpecification GetVariableSpecification (string objectReference, FunctionalConstraint fc)
 Read the variable specification (type description of a DA or FCDO.
 
MmsValue ReadValue (String objectReference, FunctionalConstraint fc)
 Read the value of a data attribute (DA) or functional constraint data object (FCDO).
 
bool ReadBooleanValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type boolean.
 
float ReadFloatValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type float.
 
string ReadStringValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type string (VisibleString or MmsString).
 
Quality ReadQualityValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type quality.
 
int ReadBitStringValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type bit string.
 
Timestamp ReadTimestampValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type timestamp (MMS_UTC_TIME).
 
Int64 ReadIntegerValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type integer (MMS_INTEGER).
 
void WriteValue (string objectReference, FunctionalConstraint fc, MmsValue value)
 Write the value of a data attribute (DA) or functional constraint data object (FCDO).
 
void DeleteFile (string fileName)
 Delete file.
 
UInt32 DeleteFileAsync (string filename, GenericServiceHandler handler, object parameter)
 Delete file- asynchronous version.
 
List< FileDirectoryEntryGetFileDirectory (string directoryName)
 Read the content of a file directory.
 
List< FileDirectoryEntryGetFileDirectoryEx (string directoryName, string continueAfter, out bool moreFollows)
 Read the content of a file directory. - single request version.
 
delegate bool GetFileHandler (object parameter, byte[] data)
 
void GetFile (string fileName, GetFileHandler handler, object parameter)
 Download a file from the server.
 
void SetFilestoreBasepath (string basepath)
 Set the virtual filestore basepath for the setFile service.
 
void SetFile (string sourceFilename, string destinationFilename)
 Upload a file to the server.
 
delegate bool GetFileAsyncHandler (UInt32 invokeId, object parameter, IedClientError err, UInt32 originalInvokeId, byte[] buffer, bool moreFollows)
 Callback handler for the asynchronous get file service. Will be invoked for each chunk of received data.
 
UInt32 GetFileAsync (string fileName, GetFileAsyncHandler handler, object parameter)
 Download a file from the server.
 
void Abort ()
 Abort (close) the connection.
 
void AbortAsync ()
 Abort (close) the connection - asynchronous version.
 
void Release ()
 Release (close) the connection.
 
void ReleaseAsync ()
 Release (close) the connection - asynchronous version.
 
void Close ()
 Immediately close the connection.
 
void InstallConnectionClosedHandler (ConnectionClosedHandler handler)
 Install a callback handler that will be invoked if the connection is closed.
 
void InstallStateChangedHandler (StateChangedHandler handler)
 Sets the handler for StateChanged events.
 
void IgnoreClientRequests (bool ignore)
 Ignore all MMS requests from clients (for testing purposes)
 
void IgnoreReadAccess (bool ignore)
 Temporarily ignore read requests (for testing purposes)
 
DataSet GetDataSetValues (string dataSetReference)
 Read the values of a data set (GetDataSetValues service).
 
DataSet ReadDataSetValues (string dataSetReference, DataSet dataSet)
 Read the values of a data set (GetDataSetValues service).
 
List< MmsDataAccessErrorWriteDataSetValues (string dataSetReference, List< MmsValue > values)
 Writes the values of a data set (SetDataSetValues service).
 
void CreateDataSet (string dataSetReference, List< string > dataSetElements)
 Create a new data set.
 
UInt32 CreateDataSetAsync (string dataSetReference, List< string > dataSetElements, GenericServiceHandler handler, object parameter)
 Create a new data set - asynchronous version.
 
bool DeleteDataSet (string dataSetReference)
 Delete a data set.
 
UInt32 DeleteDataSetAsync (string dataSetReference, GenericServiceHandler handler, object parameter)
 Delete a data set - asynchronous version.
 
List< string > GetDataSetDirectory (string dataSetReference)
 Get the directory of the data set.
 
List< string > GetDataSetDirectory (string dataSetReference, out bool isDeletable)
 Get the directory of the data set.
 
delegate void GetDataSetDirectoryHandler (UInt32 invokeId, object parameter, IedClientError err, List< string > dataSetDirectory, bool isDeletable)
 Get data set directory handler.
 
UInt32 GetDataSetDirectoryAsync (string dataSetReference, GetDataSetDirectoryHandler handler, object parameter)
 Read the data set directory - asynchronous version.
 
delegate void ReadValueHandler (UInt32 invokeId, object parameter, IedClientError err, MmsValue value)
 Read object handler.
 
UInt32 ReadValueAsync (string objectReference, FunctionalConstraint fc, ReadValueHandler handler, object parameter)
 Asynchronously read the value of a data attribute (DA) or functional constraint data object (FCDO) - GetData service.
 
delegate void GetVariableSpecifcationHandler (UInt32 invokeId, object parameter, IedClientError err, MmsVariableSpecification spec)
 
UInt32 GetVariableSpecificationAsync (string objectReference, FunctionalConstraint fc, GetVariableSpecifcationHandler handler, object parameter)
 Read the variable specification (type description of a DA or FCDO.
 
delegate void ReadDataSetHandler (UInt32 invokeId, object parameter, IedClientError err, DataSet dataSet)
 
UInt32 ReadDataSetValuesAsync (string dataSetReference, DataSet dataSet, ReadDataSetHandler handler, object parameter)
 Read the values of a data set (GetDataSetValues service) - asynchronous version.
 
delegate void WriteValueHandler (UInt32 invokeId, object parameter, IedClientError err)
 Write value handler.
 
UInt32 WriteValueAsync (string objectReference, FunctionalConstraint fc, MmsValue value, WriteValueHandler handler, object parameter)
 
delegate void GetNameListHandler (UInt32 invokeId, object parameter, IedClientError err, List< string > nameList, bool moreFollows)
 
UInt32 GetServerDirectoryAsync (List< string > result, string continueAfter, GetNameListHandler handler, object parameter)
 Gets the server directory (Logical devices or file objects)
 
UInt32 GetLogicalDeviceVariablesAsync (string ldName, string continueAfter, GetNameListHandler handler, object parameter)
 
UInt32 GetLogicalDeviceVariablesAsync (List< string > result, string ldName, string continueAfter, GetNameListHandler handler, object parameter)
 
UInt32 GetLogicalDeviceDataSetsAsync (string ldName, string continueAfter, GetNameListHandler handler, object parameter)
 
UInt32 GetLogicalDeviceDataSetsAsync (List< string > result, string ldName, string continueAfter, GetNameListHandler handler, object parameter)
 
delegate void QueryLogHandler (UInt32 invokeId, object parameter, IedClientError err, List< MmsJournalEntry > journalEntries, bool moreFollows)
 
UInt32 QueryLogByTimeAsync (string logRef, ulong startTime, ulong stopTime, QueryLogHandler handler, object parameter)
 Queries all log entries of the given time range (asynchronous version)
 
UInt32 QueryLogByTimeAsync (string logRef, DateTime startTime, DateTime stopTime, QueryLogHandler handler, object parameter)
 Queries all log entries of the given time range (asynchronous version)
 
UInt32 QueryLogAfterAsync (string logRef, byte[] entryID, ulong timestamp, QueryLogHandler handler, object parameter)
 Queries all log entries after the entry with the given entryID and timestamp (asynchronous version)
 
ReportControlBlock GetReportControlBlock (string rcbObjectReference)
 

Properties

UInt32 ConnectTimeout [get, set]
 Gets or sets the timeout used for connection attempts.
 
UInt32 RequestTimeout [get, set]
 Gets or sets the request timeout for this connection.
 
int MaxPduSize [get, set]
 Gets or sets the maximum size if a PDU (has to be set before calling connect!).
 
StateChangedHandler StateChanged [set]
 Sets the handler for StateChanged events.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ IedConnection() [1/2]

IEC61850.Client.IedConnection.IedConnection ( )

Initializes a new instance of the IEC61850.Client.IedConnection class.

◆ IedConnection() [2/2]

IEC61850.Client.IedConnection.IedConnection ( TLSConfiguration tlsConfig)

Initializes a new instance of the IEC61850.Client.IedConnection class.

Parameters
tlsConfigTLS configuration to use

Member Function Documentation

◆ Abort()

void IEC61850.Client.IedConnection.Abort ( )

Abort (close) the connection.

This function will send an abort request to the server. This will immediately interrupt the connection.

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ AbortAsync()

void IEC61850.Client.IedConnection.AbortAsync ( )

Abort (close) the connection - asynchronous version.

This function will send an abort request to the server. This will immediately interrupt the connection.

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ Close()

void IEC61850.Client.IedConnection.Close ( )

Immediately close the connection.

This function will close the connnection to the server by closing the TCP connection. The client will not send an abort or release request as required by the specification!

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ Connect() [1/2]

void IEC61850.Client.IedConnection.Connect ( string hostname)

Establish an MMS connection to a server.

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error.

◆ Connect() [2/2]

void IEC61850.Client.IedConnection.Connect ( string hostname,
int tcpPort )

Establish an MMS connection to a server.

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ConnectAsync()

void IEC61850.Client.IedConnection.ConnectAsync ( string hostname,
int tcpPort )

◆ ConnectionClosedHandler()

delegate void IEC61850.Client.IedConnection.ConnectionClosedHandler ( IedConnection connection)

Called when the connection is closed.

◆ CreateControlObject()

ControlObject IEC61850.Client.IedConnection.CreateControlObject ( string objectReference)

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ CreateDataSet()

void IEC61850.Client.IedConnection.CreateDataSet ( string dataSetReference,
List< string > dataSetElements )

Create a new data set.

This function creates a new data set at the server. The data set consists of the members defined by the list of object references provided.

Parameters
dataSetReferenceThe object reference of the data set
dataSetElementsA list of object references of the data set elements
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ CreateDataSetAsync()

UInt32 IEC61850.Client.IedConnection.CreateDataSetAsync ( string dataSetReference,
List< string > dataSetElements,
GenericServiceHandler handler,
object parameter )

Create a new data set - asynchronous version.

This function creates a new data set at the server. The data set consists of the members defined by the list of object references provided.

Parameters
dataSetReferenceThe object reference of the data set
dataSetElementsA list of object references of the data set elements
handlerCallback function to handle the received response or service timeout
parameterUser provided callback parameter. Will be passed to the callback function
Returns
the invoke ID of the sent request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ DeleteDataSet()

bool IEC61850.Client.IedConnection.DeleteDataSet ( string dataSetReference)

Delete a data set.

This function will delete a data set at the server. This function may fail if the data set is not deletable.

Parameters
dataSetReferenceThe object reference of the data set
Returns
true if data set has been deleted, false otherwise
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ DeleteDataSetAsync()

UInt32 IEC61850.Client.IedConnection.DeleteDataSetAsync ( string dataSetReference,
GenericServiceHandler handler,
object parameter )

Delete a data set - asynchronous version.

This function will delete a data set at the server. This function may fail if the data set is not deletable.

Parameters
dataSetReferenceThe object reference of the data set
handlerCallback function to handle the received response or service timeout
parameterUser provided callback parameter. Will be passed to the callback function
Returns
the invoke ID of the sent request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ DeleteFile()

void IEC61850.Client.IedConnection.DeleteFile ( string fileName)

Delete file.

Parameters
fileNameThe name of the file.
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ DeleteFileAsync()

UInt32 IEC61850.Client.IedConnection.DeleteFileAsync ( string filename,
GenericServiceHandler handler,
object parameter )

Delete file- asynchronous version.

Parameters
fileNameThe name of the file.
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ Dispose()

void IEC61850.Client.IedConnection.Dispose ( )

Releases all resource used by the IEC61850.Client.IedConnection object.

Call Dispose when you are finished using the IEC61850.Client.IedConnection. The Dispose method leaves the IEC61850.Client.IedConnection in an unusable state. After calling Dispose, you must release all references to the IEC61850.Client.IedConnection so the garbage collector can reclaim the memory that the IEC61850.Client.IedConnection was occupying.

◆ GetConnectionParameters()

IsoConnectionParameters IEC61850.Client.IedConnection.GetConnectionParameters ( )

Gets the connection parameters.

Returns
The connection parameters

◆ GetDataDirectory() [1/2]

List< string > IEC61850.Client.IedConnection.GetDataDirectory ( string dataReference)

Get a list of attributes (with functional constraints) of a DO, SDO, or DA.

Parameters
dataReferenceThe object reference of a DO, SDO, or DA.
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetDataDirectory() [2/2]

List< string > IEC61850.Client.IedConnection.GetDataDirectory ( string dataReference,
FunctionalConstraint fc )

Get the list of attributes with the specified FC of a DO, SDO, or DA.

Parameters
dataReferenceThe object reference of a DO, SDO, or DA.
fcFunctional constraint
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetDataDirectoryFC()

List< string > IEC61850.Client.IedConnection.GetDataDirectoryFC ( string dataReference)

Get a list of attributes (with functional constraints) of a DO, SDO, or DA.

This function is similar to the GetDataDirectory except that the returned element names have the functional contraint (FC) appended.

Parameters
dataReferenceThe object reference of a DO, SDO, or DA.
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetDataSetDirectory() [1/2]

List< string > IEC61850.Client.IedConnection.GetDataSetDirectory ( string dataSetReference)

Get the directory of the data set.

This function returns a list of object references with appended functional constraints (FC) of the data set elemenents.

Parameters
dataSetReferenceThe object reference of the data set
Returns
the list of object references
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetDataSetDirectory() [2/2]

List< string > IEC61850.Client.IedConnection.GetDataSetDirectory ( string dataSetReference,
out bool isDeletable )

Get the directory of the data set.

This function returns a list of object references with appended functional constraints (FC) of the data set elemenents.

Parameters
dataSetReferenceThe object reference of the data set
isDeletableIndication if this data set is permanent or deletable.
Returns
the list of object references
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetDataSetDirectoryAsync()

UInt32 IEC61850.Client.IedConnection.GetDataSetDirectoryAsync ( string dataSetReference,
GetDataSetDirectoryHandler handler,
object parameter )

Read the data set directory - asynchronous version.

Returns
The data set directory async.
Parameters
dataSetReferenceData set reference.
handlerCallback function to handle the received response or service timeout
parameterUser provided callback parameter. Will be passed to the callback function
Returns
the invoke ID of the sent request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetDataSetDirectoryHandler()

delegate void IEC61850.Client.IedConnection.GetDataSetDirectoryHandler ( UInt32 invokeId,
object parameter,
IedClientError err,
List< string > dataSetDirectory,
bool isDeletable )

Get data set directory handler.

Parameters
invokeIdThe invoke ID of the reqeust triggering this callback
parameteruser provided callback parameter
errError code of response or timeout error in case of a response timeout
dataSetDirectorythe list of data set entry references
isDeletabledata set can be deleted by a client (dynamic data set)

◆ GetDataSetValues()

DataSet IEC61850.Client.IedConnection.GetDataSetValues ( string dataSetReference)

Read the values of a data set (GetDataSetValues service).

This function will invoke a readDataSetValues service and return a new DataSet value containing the received values.

Parameters
dataSetReferenceThe object reference of the data set
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetFile()

void IEC61850.Client.IedConnection.GetFile ( string fileName,
GetFileHandler handler,
object parameter )

Download a file from the server.

Parameters
fileNameFile name of the file (full path)
handlerCallback handler that is invoked for each chunk of the file received
parameterUser provided parameter that is passed to the callback handler
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetFileAsync()

UInt32 IEC61850.Client.IedConnection.GetFileAsync ( string fileName,
GetFileAsyncHandler handler,
object parameter )

Download a file from the server.

Parameters
fileNameFile name of the file (full path)
handlerCallback handler that is invoked for each chunk of the file received
parameterUser provided parameter that is passed to the callback handler
Returns
invoke ID of the request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetFileAsyncHandler()

delegate bool IEC61850.Client.IedConnection.GetFileAsyncHandler ( UInt32 invokeId,
object parameter,
IedClientError err,
UInt32 originalInvokeId,
byte[] buffer,
bool moreFollows )

Callback handler for the asynchronous get file service. Will be invoked for each chunk of received data.

Parameters
invokeIdThe invoke ID of the reqeust triggering this callback
parameteruser provided callback parameter
errError code of response or timeout error in case of a response timeout
originalInvokeIdthe invokeId of the first (file open) request
bufferthe file data received with the last response, or null if no file data available
moreFollowsindicates that more file data follows
Returns
true, continue the file download when moreFollows is true, false, stop file download

◆ GetFileDirectory()

List< FileDirectoryEntry > IEC61850.Client.IedConnection.GetFileDirectory ( string directoryName)

Read the content of a file directory.

Parameters
directoryNameThe name of the directory.
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetFileDirectoryEx()

List< FileDirectoryEntry > IEC61850.Client.IedConnection.GetFileDirectoryEx ( string directoryName,
string continueAfter,
out bool moreFollows )

Read the content of a file directory. - single request version.

Parameters
directoryNameThe name of the directory.
continueAfterthe filename that defines the continuation point, or null for the first request
moreFollowstrue, when more files are available, false otherwise
Returns
list of file directory entries
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetFileHandler()

delegate bool IEC61850.Client.IedConnection.GetFileHandler ( object parameter,
byte[] data )

◆ GetGooseControlBlock()

GooseControlBlock IEC61850.Client.IedConnection.GetGooseControlBlock ( string gocbObjectReference)

Creates a new SampledValuesControlBlock instance.

Returns
The new GoCB instance
Parameters
gocbObjectReferenceThe object reference of the GoCB (e.g. "simpleIOGenericIO/LLN0.gcbAnalogValues")

◆ GetLogicalDeviceDataSetsAsync() [1/2]

UInt32 IEC61850.Client.IedConnection.GetLogicalDeviceDataSetsAsync ( List< string > result,
string ldName,
string continueAfter,
GetNameListHandler handler,
object parameter )

◆ GetLogicalDeviceDataSetsAsync() [2/2]

UInt32 IEC61850.Client.IedConnection.GetLogicalDeviceDataSetsAsync ( string ldName,
string continueAfter,
GetNameListHandler handler,
object parameter )

◆ GetLogicalDeviceDirectory()

List< string > IEC61850.Client.IedConnection.GetLogicalDeviceDirectory ( string logicalDeviceName)

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetLogicalDeviceVariablesAsync() [1/2]

UInt32 IEC61850.Client.IedConnection.GetLogicalDeviceVariablesAsync ( List< string > result,
string ldName,
string continueAfter,
GetNameListHandler handler,
object parameter )

◆ GetLogicalDeviceVariablesAsync() [2/2]

UInt32 IEC61850.Client.IedConnection.GetLogicalDeviceVariablesAsync ( string ldName,
string continueAfter,
GetNameListHandler handler,
object parameter )

◆ GetLogicalNodeDirectory()

List< string > IEC61850.Client.IedConnection.GetLogicalNodeDirectory ( string logicalNodeName,
ACSIClass acsiClass )

Get the directory of a logical node (LN)

This function returns the directory contents of a LN. Depending on the provided ACSI class The function returns either data object references, or references of other objects like data sets, report control blocks, ...

Parameters
logicalNodeNameThe object reference of a DO, SDO, or DA.
acsiClassthe ACSI class of the requested directory elements.
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetMmsConnection()

MmsConnection IEC61850.Client.IedConnection.GetMmsConnection ( )

Gets the underlying MmsConnection instance.

Returns
The mms connection.

◆ GetNameListHandler()

delegate void IEC61850.Client.IedConnection.GetNameListHandler ( UInt32 invokeId,
object parameter,
IedClientError err,
List< string > nameList,
bool moreFollows )

◆ GetReportControlBlock()

ReportControlBlock IEC61850.Client.IedConnection.GetReportControlBlock ( string rcbObjectReference)

◆ GetServerDirectory()

List< string > IEC61850.Client.IedConnection.GetServerDirectory ( bool fileDirectory = false)

Gets the server directory (Logical devices or file objects)

Returns
List of logical devices or files
Parameters
fileDirectoryIf set to true the file directory is returned, otherwise the LD names
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetServerDirectoryAsync()

UInt32 IEC61850.Client.IedConnection.GetServerDirectoryAsync ( List< string > result,
string continueAfter,
GetNameListHandler handler,
object parameter )

Gets the server directory (Logical devices or file objects)

Parameters
resultlist where to store the result or null to create a new list for the result
continueAftercontinuation value (last received name)
handleruser provided callback function
parameteruser provided callback parameter
Returns
the invoke ID of the sent request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetState()

IedConnectionState IEC61850.Client.IedConnection.GetState ( )

Gets the current state of the connection.

Returns
The current connection state

◆ GetSvControlBlock()

SampledValuesControlBlock IEC61850.Client.IedConnection.GetSvControlBlock ( string svcbObjectReference)

Creates a new SampledValuesControlBlock instance.

> This function will also read the SVCB values from the server.

Returns
The new SVCB instance
Parameters
svcbObjectReferenceThe object reference of the SVCB

◆ GetVariableSpecifcationHandler()

delegate void IEC61850.Client.IedConnection.GetVariableSpecifcationHandler ( UInt32 invokeId,
object parameter,
IedClientError err,
MmsVariableSpecification spec )

◆ GetVariableSpecification()

MmsVariableSpecification IEC61850.Client.IedConnection.GetVariableSpecification ( string objectReference,
FunctionalConstraint fc )

Read the variable specification (type description of a DA or FCDO.

Parameters
objectReferenceThe object reference of a DA or FCDO.
fcThe functional constraint (FC) of the object
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ GetVariableSpecificationAsync()

UInt32 IEC61850.Client.IedConnection.GetVariableSpecificationAsync ( string objectReference,
FunctionalConstraint fc,
GetVariableSpecifcationHandler handler,
object parameter )

Read the variable specification (type description of a DA or FCDO.

Parameters
objectReferenceThe object reference of a DA or FCDO.
fcThe functional constraint (FC) of the object
handlerCallback function to handle the received response or service timeout
parameterUser provided callback parameter. Will be passed to the callback function
Returns
the invoke ID of the sent request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ IgnoreClientRequests()

void IEC61850.Client.IedConnection.IgnoreClientRequests ( bool ignore)

Ignore all MMS requests from clients (for testing purposes)

Parameters
ignorewhen true all requests from clients will be ignored

◆ IgnoreReadAccess()

void IEC61850.Client.IedConnection.IgnoreReadAccess ( bool ignore)

Temporarily ignore read requests (for testing purposes)

Parameters
ignoretrue to ignore read requests, false to handle read requests.

◆ InstallConnectionClosedHandler()

void IEC61850.Client.IedConnection.InstallConnectionClosedHandler ( ConnectionClosedHandler handler)

Install a callback handler that will be invoked if the connection is closed.

The handler is called when the connection is closed no matter if the connection was closed by the client or by the server. Any new call to this function will replace the callback handler installed by a prior function call.

Parameters
handlerThe user provided callback handler
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ InstallStateChangedHandler()

void IEC61850.Client.IedConnection.InstallStateChangedHandler ( StateChangedHandler handler)

Sets the handler for StateChanged events.

Parameters
handlerThe state changed event handler

◆ QueryLogAfter()

List< MmsJournalEntry > IEC61850.Client.IedConnection.QueryLogAfter ( string logRef,
byte[] entryID,
ulong timestamp,
out bool moreFollows )

Queries all log entries after the entry with the given entryID and timestamp.

Returns
The list of log entries contained in the response
Parameters
logRefThe object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog")
entryIDEntryID of the last received MmsJournalEntry
timestampTimestamp of the last received MmsJournalEntry
moreFollowsIndicates that more log entries are available
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ QueryLogAfterAsync()

UInt32 IEC61850.Client.IedConnection.QueryLogAfterAsync ( string logRef,
byte[] entryID,
ulong timestamp,
QueryLogHandler handler,
object parameter )

Queries all log entries after the entry with the given entryID and timestamp (asynchronous version)

Returns
The list of log entries contained in the response
Parameters
logRefThe object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog")
entryIDEntryID of the last received MmsJournalEntry
handleruser provided callback function
parameteruser provided callback parameter
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ QueryLogByTime() [1/2]

List< MmsJournalEntry > IEC61850.Client.IedConnection.QueryLogByTime ( string logRef,
DateTime startTime,
DateTime stopTime,
out bool moreFollows )

Queries all log entries of the given time range.

Returns
The list of log entries contained in the response
Parameters
logRefThe object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog")
startTimeStart time of the time range
stopTimeEnd time of the time range
moreFollowsIndicates that more log entries are available
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ QueryLogByTime() [2/2]

List< MmsJournalEntry > IEC61850.Client.IedConnection.QueryLogByTime ( string logRef,
ulong startTime,
ulong stopTime,
out bool moreFollows )

Queries all log entries of the given time range.

Returns
The list of log entries contained in the response
Parameters
logRefThe object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog")
startTimeStart time of the time range
stopTimeEnd time of the time range
moreFollowsIndicates that more log entries are available
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ QueryLogByTimeAsync() [1/2]

UInt32 IEC61850.Client.IedConnection.QueryLogByTimeAsync ( string logRef,
DateTime startTime,
DateTime stopTime,
QueryLogHandler handler,
object parameter )

Queries all log entries of the given time range (asynchronous version)

Returns
The list of log entries contained in the response
Parameters
logRefThe object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog")
startTimeStart time of the time range
stopTimeEnd time of the time range
handleruser provided callback function
parameteruser provided callback parameter
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ QueryLogByTimeAsync() [2/2]

UInt32 IEC61850.Client.IedConnection.QueryLogByTimeAsync ( string logRef,
ulong startTime,
ulong stopTime,
QueryLogHandler handler,
object parameter )

Queries all log entries of the given time range (asynchronous version)

Returns
The list of log entries contained in the response
Parameters
logRefThe object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog")
startTimeStart time of the time range
stopTimeEnd time of the time range
handleruser provided callback function
parameteruser provided callback parameter
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ QueryLogHandler()

delegate void IEC61850.Client.IedConnection.QueryLogHandler ( UInt32 invokeId,
object parameter,
IedClientError err,
List< MmsJournalEntry > journalEntries,
bool moreFollows )

◆ ReadBitStringValue()

int IEC61850.Client.IedConnection.ReadBitStringValue ( string objectReference,
FunctionalConstraint fc )

Read the value of a basic data attribute (BDA) of type bit string.

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadBooleanValue()

bool IEC61850.Client.IedConnection.ReadBooleanValue ( string objectReference,
FunctionalConstraint fc )

Read the value of a basic data attribute (BDA) of type boolean.

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
Returns
the received boolean value
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadDataSetHandler()

delegate void IEC61850.Client.IedConnection.ReadDataSetHandler ( UInt32 invokeId,
object parameter,
IedClientError err,
DataSet dataSet )

◆ ReadDataSetValues()

DataSet IEC61850.Client.IedConnection.ReadDataSetValues ( string dataSetReference,
DataSet dataSet )

Read the values of a data set (GetDataSetValues service).

This function will invoke a readDataSetValues service and return a new DataSet value containing the received values. If an existing instance of DataSet is provided to the function the existing instance will be updated by the new values.

Parameters
dataSetReferenceThe object reference of the data set
dataSetThe object reference of an existing data set instance or null
Returns
a DataSet instance containing the received values
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadDataSetValuesAsync()

UInt32 IEC61850.Client.IedConnection.ReadDataSetValuesAsync ( string dataSetReference,
DataSet dataSet,
ReadDataSetHandler handler,
object parameter )

Read the values of a data set (GetDataSetValues service) - asynchronous version.

This function will invoke a readDataSetValues service and in case of success returns a new DataSet value containing the received values by the callback function. If an existing instance of DataSet is provided to the function the existing instance will be updated by the new values.

Parameters
dataSetReferenceThe object reference of the data set
dataSetThe object reference of an existing data set instance or null
handlerCallback function to handle the received response or service timeout
parameterUser provided callback parameter. Will be passed to the callback function
Returns
the invoke ID of the sent request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadFloatValue()

float IEC61850.Client.IedConnection.ReadFloatValue ( string objectReference,
FunctionalConstraint fc )

Read the value of a basic data attribute (BDA) of type float.

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadIntegerValue()

Int64 IEC61850.Client.IedConnection.ReadIntegerValue ( string objectReference,
FunctionalConstraint fc )

Read the value of a basic data attribute (BDA) of type integer (MMS_INTEGER).

This function should also be used if enumerations are beeing read. Because enumerations are mapped to integer types for the MMS mapping

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadQualityValue()

Quality IEC61850.Client.IedConnection.ReadQualityValue ( string objectReference,
FunctionalConstraint fc )

Read the value of a basic data attribute (BDA) of type quality.

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadStringValue()

string IEC61850.Client.IedConnection.ReadStringValue ( string objectReference,
FunctionalConstraint fc )

Read the value of a basic data attribute (BDA) of type string (VisibleString or MmsString).

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadTimestampValue()

Timestamp IEC61850.Client.IedConnection.ReadTimestampValue ( string objectReference,
FunctionalConstraint fc )

Read the value of a basic data attribute (BDA) of type timestamp (MMS_UTC_TIME).

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadValue()

MmsValue IEC61850.Client.IedConnection.ReadValue ( String objectReference,
FunctionalConstraint fc )

Read the value of a data attribute (DA) or functional constraint data object (FCDO).

Parameters
objectReferenceThe object reference of a DA or FCDO.
fcThe functional constraint (FC) of the object
Returns
the received value as an MmsValue instance
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadValueAsync()

UInt32 IEC61850.Client.IedConnection.ReadValueAsync ( string objectReference,
FunctionalConstraint fc,
ReadValueHandler handler,
object parameter )

Asynchronously read the value of a data attribute (DA) or functional constraint data object (FCDO) - GetData service.

Parameters
objectReferenceThe object reference of a DA or FCDO.
fcThe functional constraint (FC) of the object
handlerCallback function to handle the received response or service timeout
parameterUser provided callback parameter. Will be passed to the callback function
Returns
the invoke ID of the sent request
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReadValueHandler()

delegate void IEC61850.Client.IedConnection.ReadValueHandler ( UInt32 invokeId,
object parameter,
IedClientError err,
MmsValue value )

Read object handler.

Parameters
invokeIdThe invoke ID of the reqeust triggering this callback
parameteruser provided callback parameter
errError code of response or timeout error in case of a response timeout
valueThe read result value or null in case of an error

◆ Release()

void IEC61850.Client.IedConnection.Release ( )

Release (close) the connection.

This function will send an release request to the server. The function will block until the connection is released or an error occured.

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ ReleaseAsync()

void IEC61850.Client.IedConnection.ReleaseAsync ( )

Release (close) the connection - asynchronous version.

This function will send an release request to the server. The function will block until the connection is released or an error occured.

Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ SetFile()

void IEC61850.Client.IedConnection.SetFile ( string sourceFilename,
string destinationFilename )

Upload a file to the server.

Parameters
sourceFilenameThe filename of the local (client side) file
destinationFilenameThe filename of the remote (service side) file

◆ SetFilestoreBasepath()

void IEC61850.Client.IedConnection.SetFilestoreBasepath ( string basepath)

Set the virtual filestore basepath for the setFile service.

Parameters
basepathThe new virtual filestore basepath

◆ SetLocalAddress() [1/2]

void IEC61850.Client.IedConnection.SetLocalAddress ( string localIpAddress)

Set the local IP address to be used by the client.

Parameters
localIpAddressthe local IP address or hostname

◆ SetLocalAddress() [2/2]

void IEC61850.Client.IedConnection.SetLocalAddress ( string localIpAddress,
int localPort )

Set the local IP address and port to be used by the client.

Parameters
localIpAddressthe local IP address or hostname
localPortthe local TCP port to use. When 0 the OS will chose the TCP port to use.

◆ SetMaxOutstandingCalls()

void IEC61850.Client.IedConnection.SetMaxOutstandingCalls ( int calling,
int called )

Set the maximum number outstanding calls allowed for this connection.

Parameters
callingthe maximum outstanding calls allowed by the caller (client)
calledthe maximum outstanding calls allowed by the called endpoint (server)

◆ SetTimeQuality()

void IEC61850.Client.IedConnection.SetTimeQuality ( bool leapSecondKnown,
bool clockFailure,
bool clockNotSynchronized,
int subsecondPrecision )

Set the time quality for all timestamps generated by this IedConnection instance.

Parameters
leapSecondKnownset or unset leap seconds known flag
clockFailureset or unset clock failure flag
clockNotSynchronizedset or unset clock not synchronized flag
subsecondPrecisionset the subsecond precision (number of significant bits of the fractionOfSecond part of the time stamp)

◆ StateChangedHandler()

delegate void IEC61850.Client.IedConnection.StateChangedHandler ( IedConnection connection,
IedConnectionState newState )

Called when there is a change in the connection state.

◆ UpdateDeviceModel()

void IEC61850.Client.IedConnection.UpdateDeviceModel ( )

Updates the device model by quering the server.

◆ WriteDataSetValues()

List< MmsDataAccessError > IEC61850.Client.IedConnection.WriteDataSetValues ( string dataSetReference,
List< MmsValue > values )

Writes the values of a data set (SetDataSetValues service).

Returns
The list of access results
Parameters
dataSetReferenceThe object reference of the data set
valuesThe new values for the data set members. The values have to be of the same number and type as the data set members

◆ WriteValue()

void IEC61850.Client.IedConnection.WriteValue ( string objectReference,
FunctionalConstraint fc,
MmsValue value )

Write the value of a data attribute (DA) or functional constraint data object (FCDO).

This function can be used to write simple or complex variables (setpoints, parameters, descriptive values...) of the server.

Parameters
objectReferenceThe object reference of a BDA.
fcThe functional constraint (FC) of the object
valueMmsValue object representing asimple or complex variable data
Exceptions
IedConnectionExceptionThis exception is thrown if there is a connection or service error

◆ WriteValueAsync()

UInt32 IEC61850.Client.IedConnection.WriteValueAsync ( string objectReference,
FunctionalConstraint fc,
MmsValue value,
WriteValueHandler handler,
object parameter )

◆ WriteValueHandler()

delegate void IEC61850.Client.IedConnection.WriteValueHandler ( UInt32 invokeId,
object parameter,
IedClientError err )

Write value handler.

Parameters
invokeIdThe invoke ID of the reqeust triggering this callback
parameteruser provided callback parameter
errError code of response or timeout error in case of a response timeout

Property Documentation

◆ ConnectTimeout

UInt32 IEC61850.Client.IedConnection.ConnectTimeout
getset

Gets or sets the timeout used for connection attempts.

The connect timeout in milliseconds

◆ MaxPduSize

int IEC61850.Client.IedConnection.MaxPduSize
getset

Gets or sets the maximum size if a PDU (has to be set before calling connect!).

The maximum allowed size of an MMS PDU.

◆ RequestTimeout

UInt32 IEC61850.Client.IedConnection.RequestTimeout
getset

Gets or sets the request timeout for this connection.

The request timeout in milliseconds

◆ StateChanged

StateChangedHandler IEC61850.Client.IedConnection.StateChanged
set

Sets the handler for StateChanged events.

The state changed event handler


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