IEC 61850 .NET API  1.2.0
IEC 61850 .NET API for libiec61850 protocol library
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...

Public Member Functions

delegate void ConnectionClosedHandler (IedConnection connection)
 
 IedConnection ()
 Initializes a new instance of the IEC61850.Client.IedConnection class. More...
 
 IedConnection (TLSConfiguration tlsConfig)
 Initializes a new instance of the IEC61850.Client.IedConnection class. More...
 
void Dispose ()
 Releases all resource used by the IEC61850.Client.IedConnection object. More...
 
IsoConnectionParameters GetConnectionParameters ()
 Gets the connection parameters More...
 
MmsConnection GetMmsConnection ()
 
void Connect (string hostname, int tcpPort)
 Establish an MMS connection to a server More...
 
void Connect (string hostname)
 Establish an MMS connection to a server. More...
 
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. More...
 
GooseControlBlock GetGooseControlBlock (string gocbObjectReference)
 Creates a new SampledValuesControlBlock instance. More...
 
void UpdateDeviceModel ()
 Updates the device model by quering the server. More...
 
List< string > GetServerDirectory (bool fileDirectory=false)
 Gets the server directory (Logical devices or file objects) More...
 
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) More...
 
List< string > GetDataDirectory (string dataReference)
 Get a list of attributes (with functional constraints) of a DO, SDO, or DA More...
 
List< string > GetDataDirectory (string dataReference, FunctionalConstraint fc)
 Get the list of attributes with the specified FC of a DO, SDO, or DA More...
 
List< string > GetDataDirectoryFC (string dataReference)
 Get a list of attributes (with functional constraints) of a DO, SDO, or DA More...
 
List< MmsJournalEntryQueryLogAfter (string logRef, byte[] entryID, ulong timestamp, out bool moreFollows)
 Queries all log entries after the entry with the given entryID and timestamp More...
 
List< MmsJournalEntryQueryLogByTime (string logRef, ulong startTime, ulong stopTime, out bool moreFollows)
 Queries all log entries of the given time range More...
 
List< MmsJournalEntryQueryLogByTime (string logRef, DateTime startTime, DateTime stopTime, out bool moreFollows)
 Queries all log entries of the given time range More...
 
MmsVariableSpecification GetVariableSpecification (string objectReference, FunctionalConstraint fc)
 Read the variable specification (type description of a DA or FCDO More...
 
MmsValue ReadValue (String objectReference, FunctionalConstraint fc)
 Read the value of a data attribute (DA) or functional constraint data object (FCDO). More...
 
bool ReadBooleanValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type boolean. More...
 
float ReadFloatValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type float. More...
 
string ReadStringValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type string (VisibleString or MmsString). More...
 
Quality ReadQualityValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type quality. More...
 
int ReadBitStringValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type bit string. More...
 
Timestamp ReadTimestampValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type timestamp (MMS_UTC_TIME). More...
 
Int64 ReadIntegerValue (string objectReference, FunctionalConstraint fc)
 Read the value of a basic data attribute (BDA) of type integer (MMS_INTEGER). More...
 
void WriteValue (string objectReference, FunctionalConstraint fc, MmsValue value)
 Write the value of a data attribute (DA) or functional constraint data object (FCDO). More...
 
void DeleteFile (string fileName)
 Delete file More...
 
List< FileDirectoryEntryGetFileDirectory (string directoryName)
 Read the content of a file directory. More...
 
delegate bool GetFileHandler (object parameter, byte[] data)
 
void GetFile (string fileName, GetFileHandler handler, object parameter)
 Download a file from the server. More...
 
void Abort ()
 Abort (close) the connection. More...
 
void Release ()
 Release (close) the connection. More...
 
void Close ()
 Immediately close the connection. More...
 
void InstallConnectionClosedHandler (ConnectionClosedHandler handler)
 Install a callback handler that will be invoked if the connection is closed. More...
 
DataSet GetDataSetValues (string dataSetReference)
 Read the values of a data set (GetDataSetValues service). More...
 
DataSet ReadDataSetValues (string dataSetReference, DataSet dataSet)
 Read the values of a data set (GetDataSetValues service). More...
 
List< MmsDataAccessErrorWriteDataSetValues (string dataSetReference, List< MmsValue > values)
 Writes the values of a data set (SetDataSetValues service). More...
 
void CreateDataSet (string dataSetReference, List< string > dataSetElements)
 Create a new data set. More...
 
bool DeleteDataSet (string dataSetReference)
 Delete a data set. More...
 
List< string > GetDataSetDirectory (string dataSetReference)
 Get the directory of the data set. More...
 
List< string > GetDataSetDirectory (string dataSetReference, out bool isDeletable)
 Get the directory of the data set. More...
 
ReportControlBlock GetReportControlBlock (string rcbObjectReference)
 

Package Functions

void RemoveRCB (ReportControlBlock rcb)
 

Properties

UInt32 ConnectTimeout [get, set]
 Gets or sets the timeout used for connection attempts. 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.

Constructor & Destructor Documentation

IEC61850.Client.IedConnection.IedConnection ( )

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

IEC61850.Client.IedConnection.IedConnection ( TLSConfiguration  tlsConfig)

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

Parameters
tlsConfigTLS configuration to use

Member Function Documentation

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

IsoConnectionParameters IEC61850.Client.IedConnection.GetConnectionParameters ( )

Gets the connection parameters

Returns
The connection parameters
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
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
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
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
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
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
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
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
GooseControlBlock IEC61850.Client.IedConnection.GetGooseControlBlock ( string  gocbObjectReference)

Creates a new SampledValuesControlBlock instance.

Returns
The new GoCB instance
Parameters
gocbObjectReferenceThe object reference of the GoCB
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
void IEC61850.Client.IedConnection.UpdateDeviceModel ( )

Updates the device model by quering the server.

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

Property Documentation

UInt32 IEC61850.Client.IedConnection.ConnectTimeout
getset

Gets or sets the timeout used for connection attempts.

The connect timeout in milliseconds


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