IEC 61850 .NET API
1.2.0
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...
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) | ||
| |||
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) | ||
| |||
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< MmsJournalEntry > | QueryLogAfter (string logRef, byte[] entryID, ulong timestamp, out bool moreFollows) | ||
Queries all log entries after the entry with the given entryID and timestamp More... | |||
List< MmsJournalEntry > | QueryLogByTime (string logRef, ulong startTime, ulong stopTime, out bool moreFollows) | ||
Queries all log entries of the given time range More... | |||
List< MmsJournalEntry > | QueryLogByTime (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< FileDirectoryEntry > | GetFileDirectory (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< MmsDataAccessError > | WriteDataSetValues (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... | |
This class acts as the entry point for the IEC 61850 client API. It represents a single (MMS) connection to a server.
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.
tlsConfig | TLS configuration to use |
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.
IedConnectionException | This 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!
IedConnectionException | This 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
IedConnectionException | This 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.
IedConnectionException | This 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.
dataSetReference | The object reference of the data set |
dataSetElements | A list of object references of the data set elements |
IedConnectionException | This 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.
dataSetReference | The object reference of the data set |
IedConnectionException | This exception is thrown if there is a connection or service error |
void IEC61850.Client.IedConnection.DeleteFile | ( | string | fileName | ) |
Delete file
fileName | The name of the file. |
IedConnectionException | This 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
List<string> IEC61850.Client.IedConnection.GetDataDirectory | ( | string | dataReference | ) |
Get a list of attributes (with functional constraints) of a DO, SDO, or DA
dataReference | The object reference of a DO, SDO, or DA. |
IedConnectionException | This 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
dataReference | The object reference of a DO, SDO, or DA. |
fc | Functional constraint |
IedConnectionException | This 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.
dataReference | The object reference of a DO, SDO, or DA. |
IedConnectionException | This 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.
dataSetReference | The object reference of the data set |
IedConnectionException | This 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.
dataSetReference | The object reference of the data set |
isDeletable | Indication if this data set is permanent or deletable. |
IedConnectionException | This 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.
dataSetReference | The object reference of the data set |
IedConnectionException | This 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.
fileName | File name of the file (full path) |
handler | Callback handler that is invoked for each chunk of the file received |
parameter | User provided parameter that is passed to the callback handler |
List<FileDirectoryEntry> IEC61850.Client.IedConnection.GetFileDirectory | ( | string | directoryName | ) |
Read the content of a file directory.
directoryName | The name of the directory. |
IedConnectionException | This exception is thrown if there is a connection or service error |
GooseControlBlock IEC61850.Client.IedConnection.GetGooseControlBlock | ( | string | gocbObjectReference | ) |
Creates a new SampledValuesControlBlock instance.
gocbObjectReference | The 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, ...
logicalNodeName | The object reference of a DO, SDO, or DA. |
acsiClass | the ACSI class of the requested directory elements. |
IedConnectionException | This 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)
fileDirectory | If set to true the file directory is returned, otherwise the LD names |
IedConnectionException | This 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.
svcbObjectReference | The 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
objectReference | The object reference of a DA or FCDO. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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.
handler | The user provided callback handler |
IedConnectionException | This 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
logRef | The object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog") |
entryID | EntryID of the last received MmsJournalEntry |
timestamp | Timestamp of the last received MmsJournalEntry |
moreFollows | Indicates that more log entries are available |
IedConnectionException | This 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
logRef | The object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog") |
startTime | Start time of the time range |
stopTime | End time of the time range |
moreFollows | Indicates that more log entries are available |
IedConnectionException | This 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
logRef | The object reference of the log (e.g. "simpleIOGenericIO/LLN0$EventLog") |
startTime | Start time of the time range |
stopTime | End time of the time range |
moreFollows | Indicates that more log entries are available |
IedConnectionException | This 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.
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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.
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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.
dataSetReference | The object reference of the data set |
dataSet | The object reference of an existing data set instance or null |
IedConnectionException | This 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.
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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.
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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).
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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).
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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).
objectReference | The object reference of a DA or FCDO. |
fc | The functional constraint (FC) of the object |
IedConnectionException | This 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.
IedConnectionException | This 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).
dataSetReference | The object reference of the data set |
values | The 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.
objectReference | The object reference of a BDA. |
fc | The functional constraint (FC) of the object |
value | MmsValue object representing asimple or complex variable data |
IedConnectionException | This exception is thrown if there is a connection or service error |
|
getset |
Gets or sets the timeout used for connection attempts.
The connect timeout in milliseconds