|
libiec61850.NET 1.6.1
IEC 61850 .NET API for libiec61850 protocol library
|
This class is used to hold MMS data values of different types. More...
Public Member Functions | |
| int | EncodeMmsData (byte[] buffer, int bufPos, bool encode) |
| int | DecodeMmsData (int bufPos, int bufferLength, IntPtr endBufPo) |
| MmsValue (bool value) | |
| MmsValue (float value) | |
| MmsValue (double value) | |
| MmsValue (int value) | |
| MmsValue (UInt32 value) | |
| MmsValue (long value) | |
| MmsValue (string value) | |
| Create a new IEC61850.Common.MmsValue instance of type MMS_VISIBLE_STRING. | |
| void | Dispose () |
| MmsValue (byte[] octetString) | |
| void | SetBinaryTime (UInt64 timestamp) |
| Sets the binary time. | |
| ulong | GetBinaryTimeAsUtcMs () |
| Gets the binary time value as UTC time in ms. | |
| void | SetVisibleString (string value) |
| Set the value of an MmsValue instance of type MMS_VISIBLE_STRING. | |
| new MmsType | GetType () |
| Gets the type of the value. | |
| int | Size () |
| Gets the size of an array, structure, or bit string. | |
| int | MaxSize () |
| Gets the maximum size of an octet string. | |
| byte[] | getOctetString () |
| Gets the octet string as byte array. | |
| void | setOctetString (byte[] octetString) |
| Sets the value of an octet string by a byte array. | |
| byte | GetOctetStringOctet (int pos) |
| Gets the octet string octet. | |
| void | SetOctetStringOctet (int pos, byte value) |
| Sets the octet string octet. | |
| MmsValue | GetElement (int index) |
| Get an element of an array or structure. | |
| void | SetElement (int index, MmsValue elementValue) |
| Sets the element of an array or structure. | |
| MmsDataAccessError | GetDataAccessError () |
| UInt32 | ToUnixTimestamp () |
| Gets the timestamp value as UTC time in s (UNIX time stamp). | |
| void | SetUtcTimeMs (ulong timeval) |
| Sets the timestamp value as UTC time in ms. | |
| ulong | GetUtcTimeInMs () |
| Gets the timestamp value as UTC time in ms. | |
| ulong | GetUtcTimeInMsWithUs (out int usec) |
| Gets the timestamp value as UTC time in ms and the additional us part. | |
| byte | GetUtcTimeQuality () |
| Gets quality flags of an UTC timestamp. | |
| void | SetUtcTimeQuality (byte timeQuality) |
| Sets the quality flags of an UTC timestamp. | |
| DateTimeOffset | GetUtcTimeAsDateTimeOffset () |
| Convert MMS_UTC_TIME to DateTimeOffset instance. | |
| Int32 | ToInt32 () |
| Return the value as 32 bit signed integer. | |
| void | SetInt32 (int value) |
| Sets the 32 bit signed integer. | |
| Int64 | ToInt64 () |
| Return the value as 64 bit signed integer. | |
| UInt32 | ToUint32 () |
| Return the value as 32 bit unsigned integer. | |
| UInt32 | BitStringToUInt32 () |
| void | BitStringFromUInt32 (UInt32 intValue) |
| UInt32 | BitStringToUInt32BigEndian () |
| void | BitStringFromUInt32BigEndian (UInt32 intValue) |
| void | SetBit (int bitPos, bool bitValue) |
| bool | GetBit (int bitPos) |
| bool | GetBoolean () |
| Gets the boolean value. | |
| void | SetBoolean (bool value) |
| Sets the boolean value of an MMS_BOOLEAN instance. | |
| float | ToFloat () |
| Gets the float value of an MMS_FLOAT instance. | |
| void | SetFloat (float value) |
| Sets the float value of an MMS_FLOAT instance. | |
| double | ToDouble () |
| Gets the double value of an MMS_FLOAT instance. | |
| void | SetDouble (double value) |
| Sets the float/double value of an MMS_FLOAT instance. | |
| MmsValue | GetChildValue (string childPath, MmsVariableSpecification specification) |
| Gets the child value with the given name. | |
| MmsValue | Clone () |
| Get an identical copy of this instance. | |
| override bool | Equals (object obj) |
| override string | ToString () |
Static Public Member Functions | |
| static MmsValue | NewBitString (int bitSize) |
| Create a new MmsValue instance of type MMS_BIT_STRING. | |
| static MmsValue | NewOctetString (int maxSize, int size=0) |
| Create a new MmsValue instance of type MMS_OCTET_STRING. | |
| static MmsValue | NewArray (MmsVariableSpecification elementType, int size) |
| Create a new MmsValue instance of type MMS_ARRAY. Array elements have the fiven type. | |
| static MmsValue | NewEmptyArray (int size) |
| Create a new MmsValue instance of type MMS_ARRAY. Array elements are not initialized! | |
| static MmsValue | NewEmptyStructure (int size) |
| Create a new MmsValue instance of type MMS_STRUCTURE. Structure elements are not initialized! | |
| static MmsValue | NewBinaryTime (bool largeFormat) |
| Create a new MmsValue instance of type MMS_BINARY_TIME. | |
| static MmsValue | NewUtcTime (UInt64 timestamp) |
| Create a new MmsValue instance of type MMS_UTC_TIME. | |
| static MmsValue | NewVisibleString (int size, bool responsibleForDeletion=false) |
| Create a new MmsValue instance of type MMS_VISIBLE_STRING - empty string with given maximum size. | |
| static DateTimeOffset | MsTimeToDateTimeOffset (UInt64 msTime) |
| Convert a millisecond time (milliseconds since epoch) to DataTimeOffset. | |
This class is used to hold MMS data values of different types.
| IEC61850.Common.MmsValue.MmsValue | ( | bool | value | ) |
| IEC61850.Common.MmsValue.MmsValue | ( | float | value | ) |
| IEC61850.Common.MmsValue.MmsValue | ( | double | value | ) |
| IEC61850.Common.MmsValue.MmsValue | ( | int | value | ) |
| IEC61850.Common.MmsValue.MmsValue | ( | UInt32 | value | ) |
| IEC61850.Common.MmsValue.MmsValue | ( | long | value | ) |
| IEC61850.Common.MmsValue.MmsValue | ( | string | value | ) |
Create a new IEC61850.Common.MmsValue instance of type MMS_VISIBLE_STRING.
| value | Value. |
| IEC61850.Common.MmsValue.MmsValue | ( | byte[] | octetString | ) |
| void IEC61850.Common.MmsValue.BitStringFromUInt32 | ( | UInt32 | intValue | ) |
| void IEC61850.Common.MmsValue.BitStringFromUInt32BigEndian | ( | UInt32 | intValue | ) |
| UInt32 IEC61850.Common.MmsValue.BitStringToUInt32 | ( | ) |
| UInt32 IEC61850.Common.MmsValue.BitStringToUInt32BigEndian | ( | ) |
| MmsValue IEC61850.Common.MmsValue.Clone | ( | ) |
Get an identical copy of this instance.
| int IEC61850.Common.MmsValue.DecodeMmsData | ( | int | bufPos, |
| int | bufferLength, | ||
| IntPtr | endBufPo ) |
| void IEC61850.Common.MmsValue.Dispose | ( | ) |
| int IEC61850.Common.MmsValue.EncodeMmsData | ( | byte[] | buffer, |
| int | bufPos, | ||
| bool | encode ) |
| override bool IEC61850.Common.MmsValue.Equals | ( | object | obj | ) |
| ulong IEC61850.Common.MmsValue.GetBinaryTimeAsUtcMs | ( | ) |
Gets the binary time value as UTC time in ms.
Return the value as milliseconds since epoch (1.1.1970 UTC). The value has to be of type MMS_UTC_TIME.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| bool IEC61850.Common.MmsValue.GetBit | ( | int | bitPos | ) |
| bool IEC61850.Common.MmsValue.GetBoolean | ( | ) |
Gets the boolean value.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| MmsValue IEC61850.Common.MmsValue.GetChildValue | ( | string | childPath, |
| MmsVariableSpecification | specification ) |
Gets the child value with the given name.
| childPath | path specifying the child using '.' or '$' as path element separator. |
| specification | the variable specification to use. |
| MmsDataAccessError IEC61850.Common.MmsValue.GetDataAccessError | ( | ) |
| MmsValue IEC61850.Common.MmsValue.GetElement | ( | int | index | ) |
Get an element of an array or structure.
| index | index of the element starting with 0 |
| MmsValueException | This exception is thrown if the value has the wrong type. |
| MmsValueException | This exception is thrown if the index is out of range. |
| byte[] IEC61850.Common.MmsValue.getOctetString | ( | ) |
Gets the octet string as byte array.
Instance has to be of type MMS_OCTET_STRING.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| byte IEC61850.Common.MmsValue.GetOctetStringOctet | ( | int | pos | ) |
Gets the octet string octet.
| pos | Position of the octet in the octet string. |
| new MmsType IEC61850.Common.MmsValue.GetType | ( | ) |
Gets the type of the value.
| DateTimeOffset IEC61850.Common.MmsValue.GetUtcTimeAsDateTimeOffset | ( | ) |
Convert MMS_UTC_TIME to DateTimeOffset instance.
Return the value as DateTimeOffset instance. The value has to be of type MMS_UTC_TIME.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| ulong IEC61850.Common.MmsValue.GetUtcTimeInMs | ( | ) |
Gets the timestamp value as UTC time in ms.
Return the value as milliseconds since epoch (1.1.1970 UTC). The value has to be of type MMS_UTC_TIME.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| ulong IEC61850.Common.MmsValue.GetUtcTimeInMsWithUs | ( | out int | usec | ) |
Gets the timestamp value as UTC time in ms and the additional us part.
Return the value as milliseconds since epoch (1.1.1970 UTC) and the additional us part. The value has to be of type MMS_UTC_TIME.
| usec | returns the usec part of the time value |
| MmsValueException | This exception is thrown if the value has the wrong type. |
| byte IEC61850.Common.MmsValue.GetUtcTimeQuality | ( | ) |
Gets quality flags of an UTC timestamp.
Meaning of the bits in the timeQuality byte: bit 7 = leapSecondsKnown bit 6 = clockFailure bit 5 = clockNotSynchronized bit 0-4 = subsecond time accuracy (number of significant bits of subsecond time)
| int IEC61850.Common.MmsValue.MaxSize | ( | ) |
Gets the maximum size of an octet string.
|
static |
Convert a millisecond time (milliseconds since epoch) to DataTimeOffset.
| msTime | the millisecond time |
|
static |
Create a new MmsValue instance of type MMS_ARRAY. Array elements have the fiven type.
| elementType | array element type |
| size | number of array elements |
|
static |
|
static |
|
static |
Create a new MmsValue instance of type MMS_ARRAY. Array elements are not initialized!
| size | number of array elements |
|
static |
Create a new MmsValue instance of type MMS_STRUCTURE. Structure elements are not initialized!
| size | number of structure elements |
|
static |
|
static |
|
static |
Create a new MmsValue instance of type MMS_VISIBLE_STRING - empty string with given maximum size.
| size | The maximum size |
| void IEC61850.Common.MmsValue.SetBinaryTime | ( | UInt64 | timestamp | ) |
Sets the binary time.
| timestamp | Timestamp. |
| void IEC61850.Common.MmsValue.SetBit | ( | int | bitPos, |
| bool | bitValue ) |
| void IEC61850.Common.MmsValue.SetBoolean | ( | bool | value | ) |
Sets the boolean value of an MMS_BOOLEAN instance.
| value | the new value to set |
| MmsValueException | This exception is thrown if the value has the wrong type. |
| void IEC61850.Common.MmsValue.SetDouble | ( | double | value | ) |
Sets the float/double value of an MMS_FLOAT instance.
| value | the new value to set |
| MmsValueException | This exception is thrown if the value has the wrong type. |
| void IEC61850.Common.MmsValue.SetElement | ( | int | index, |
| MmsValue | elementValue ) |
Sets the element of an array or structure.
After calling this function the native memory of the element will be managed by the array or structure. Therefore an element can only be used in a single array or structure. When the value is required in multiple arrays or structures a clone has to be created before using this function! To be save, always use a clone for setting the element.
| index | index of the element starting with 0 |
| elementValue | MmsValue instance that will be used as element value |
| MmsValueException | This exception is thrown if the value has the wrong type. |
| MmsValueException | This exception is thrown if the index is out of range. |
| void IEC61850.Common.MmsValue.SetFloat | ( | float | value | ) |
Sets the float value of an MMS_FLOAT instance.
| value | the new value to set |
| MmsValueException | This exception is thrown if the value has the wrong type. |
| void IEC61850.Common.MmsValue.SetInt32 | ( | int | value | ) |
Sets the 32 bit signed integer.
| value | the new value to set |
| MmsValueException | This exception is thrown if the value has the wrong type. |
| void IEC61850.Common.MmsValue.setOctetString | ( | byte[] | octetString | ) |
Sets the value of an octet string by a byte array.
| octetString | Byte array containing the bytes of the octet string. |
| MmsValueException | This exception is thrown if the value has the wrong type or the byte array is too large. |
| void IEC61850.Common.MmsValue.SetOctetStringOctet | ( | int | pos, |
| byte | value ) |
Sets the octet string octet.
| pos | Position of the octet in the octet string. |
| value | The octet string octet. |
| void IEC61850.Common.MmsValue.SetUtcTimeMs | ( | ulong | timeval | ) |
Sets the timestamp value as UTC time in ms.
Sets the value as milliseconds since epoch (1.1.1970 UTC). The value has to be of type MMS_UTC_TIME.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| void IEC61850.Common.MmsValue.SetUtcTimeQuality | ( | byte | timeQuality | ) |
Sets the quality flags of an UTC timestamp.
Meaning of the bits in the timeQuality byte: bit 7 = leapSecondsKnown bit 6 = clockFailure bit 5 = clockNotSynchronized bit 0-4 = subsecond time accuracy (number of significant bits of subsecond time)
| timeQuality | Time quality. |
| void IEC61850.Common.MmsValue.SetVisibleString | ( | string | value | ) |
Set the value of an MmsValue instance of type MMS_VISIBLE_STRING.
| value | the new string value |
| int IEC61850.Common.MmsValue.Size | ( | ) |
Gets the size of an array, structure, or bit string.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| double IEC61850.Common.MmsValue.ToDouble | ( | ) |
Gets the double value of an MMS_FLOAT instance.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| float IEC61850.Common.MmsValue.ToFloat | ( | ) |
Gets the float value of an MMS_FLOAT instance.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| Int32 IEC61850.Common.MmsValue.ToInt32 | ( | ) |
Return the value as 32 bit signed integer.
Return the value as 32 bit signed integer (Int32). The value has to be of type MMS_INTEGER.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| Int64 IEC61850.Common.MmsValue.ToInt64 | ( | ) |
Return the value as 64 bit signed integer.
Return the value as 64 bit signed integer (Int64). The value has to be of type MMS_INTEGER.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| override string IEC61850.Common.MmsValue.ToString | ( | ) |
| UInt32 IEC61850.Common.MmsValue.ToUint32 | ( | ) |
Return the value as 32 bit unsigned integer.
Return the value as 32 bit unsigned integer (Int32). The value has to be of type MMS_INTEGER.
| MmsValueException | This exception is thrown if the value has the wrong type. |
| UInt32 IEC61850.Common.MmsValue.ToUnixTimestamp | ( | ) |
Gets the timestamp value as UTC time in s (UNIX time stamp).
Return the value as seconds since epoch (1.1.1970 UTC). The value has to be of type MMS_UTC_TIME.
| MmsValueException | This exception is thrown if the value has the wrong type. |