libiec61850  1.2.0
Functions
Data model access and data update

Functions

void IedServer_lockDataModel (IedServer self)
 Lock the MMS server data model. More...
 
void IedServer_unlockDataModel (IedServer self)
 Unlock the MMS server data model and process pending client requests. More...
 
MmsValueIedServer_getAttributeValue (IedServer self, DataAttribute *dataAttribute)
 Get data attribute value. More...
 
bool IedServer_getBooleanAttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of a boolean data attribute. More...
 
int32_t IedServer_getInt32AttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of an integer data attribute. More...
 
int64_t IedServer_getInt64AttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of an integer data attribute. More...
 
uint32_t IedServer_getUInt32AttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of an unsigned integer data attribute. More...
 
float IedServer_getFloatAttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of a floating point data attribute. More...
 
uint64_t IedServer_getUTCTimeAttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of a UTC time data attribute. More...
 
uint32_t IedServer_getBitStringAttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of a bit string data attribute as integer value. More...
 
const char * IedServer_getStringAttributeValue (IedServer self, const DataAttribute *dataAttribute)
 Get data attribute value of a string type data attribute. More...
 
MmsValueIedServer_getFunctionalConstrainedData (IedServer self, DataObject *dataObject, FunctionalConstraint fc)
 Get the MmsValue object related to a FunctionalConstrainedData object. More...
 
void IedServer_updateAttributeValue (IedServer self, DataAttribute *dataAttribute, MmsValue *value)
 Update the MmsValue object of an IEC 61850 data attribute. More...
 
void IedServer_updateFloatAttributeValue (IedServer self, DataAttribute *dataAttribute, float value)
 Update the value of an IEC 61850 float data attribute. More...
 
void IedServer_updateInt32AttributeValue (IedServer self, DataAttribute *dataAttribute, int32_t value)
 Update the value of an IEC 61850 integer32 data attribute. More...
 
void IedServer_udpateDbposValue (IedServer self, DataAttribute *dataAttribute, Dbpos value)
 Update the value of an IEC 61850 Dbpos (double point/position) data attribute. More...
 
void IedServer_updateInt64AttributeValue (IedServer self, DataAttribute *dataAttribute, int64_t value)
 Update the value of an IEC 61850 integer64 data attribute (like BCR actVal) More...
 
void IedServer_updateUnsignedAttributeValue (IedServer self, DataAttribute *dataAttribute, uint32_t value)
 Update the value of an IEC 61850 unsigned integer data attribute. More...
 
void IedServer_updateBitStringAttributeValue (IedServer self, DataAttribute *dataAttribute, uint32_t value)
 Update the value of an IEC 61850 bit string data attribute. More...
 
void IedServer_updateBooleanAttributeValue (IedServer self, DataAttribute *dataAttribute, bool value)
 Update the value of an IEC 61850 boolean data attribute. More...
 
void IedServer_updateVisibleStringAttributeValue (IedServer self, DataAttribute *dataAttribute, char *value)
 Update the value of an IEC 61850 visible string data attribute. More...
 
void IedServer_updateUTCTimeAttributeValue (IedServer self, DataAttribute *dataAttribute, uint64_t value)
 Update the value of an IEC 61850 UTC time (timestamp) data attribute. More...
 
void IedServer_updateTimestampAttributeValue (IedServer self, DataAttribute *dataAttribute, Timestamp *timestamp)
 Update the value of an IEC 61850 UTC time (timestamp) data attribute. More...
 
void IedServer_updateQuality (IedServer self, DataAttribute *dataAttribute, Quality quality)
 Update a quality ("q") IEC 61850 data attribute. More...
 

Detailed Description

Function Documentation

MmsValue* IedServer_getAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute 
)

Get data attribute value.

Get the MmsValue object of an MMS Named Variable that is part of the device model. You should not manipulate the received object directly. Instead you should use the IedServer_updateValue method.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
MmsValue object of the MMS Named Variable or NULL if the value does not exist.
uint32_t IedServer_getBitStringAttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of a bit string data attribute as integer value.

Get the value of a data attribute of type MMS_BIT_STRING. If the data attribute is of a different type the returned value is undefined. NOTE: The returned integer is determined by calculating the according the follwing formula: bit0^0 + bit1^1 + ... + bitn^n It is not specified in the IEC 61850 specifications how a bit string can be interpreted as an integer. Therefore this function has to be used with care.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
the value a 32 bit integer.
bool IedServer_getBooleanAttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of a boolean data attribute.

Get the value of a data attribute of type MMS_BOOLEAN. If the data attribute is of a different type the returned value is undefined.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
true or false
float IedServer_getFloatAttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of a floating point data attribute.

Get the value of a data attribute of type MMS_FLOAT. If the data attribute is of a different type the returned value is undefined.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
the value as 32 bit float
MmsValue* IedServer_getFunctionalConstrainedData ( IedServer  self,
DataObject *  dataObject,
FunctionalConstraint  fc 
)

Get the MmsValue object related to a FunctionalConstrainedData object.

Get the MmsValue from the server cache that is associated with the Functional Constrained Data (FCD) object that is specified by the DataObject and the given Function Constraint (FC). Accessing the value will directly influence the values presented by the server. This kind of direct access will also bypass the report notification mechanism (i.e. changes will not cause a report!). Therefore this function should be used with care. It could be useful to access arrays of DataObjects.

Parameters
selfthe instance of IedServer to operate on.
dataObjectthe data object to specify the FCD
fcthe FC to specify the FCD
Returns
MmsValue object cached by the server.
int32_t IedServer_getInt32AttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of an integer data attribute.

Get the value of a data attribute of type MMS_INTEGER. If the data attribute is of a different type the returned value is undefined.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
the value as 32 bit integer
int64_t IedServer_getInt64AttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of an integer data attribute.

Get the value of a data attribute of type MMS_INTEGER. If the data attribute is of a different type the returned value is undefined.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
the value as 64 bit integer
const char* IedServer_getStringAttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of a string type data attribute.

Get the value of a data attribute of type MMS_STRING or MMS_VISIBLE_STRING. If the data attribute is of a different type the returned value is undefined.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
the value as a C string (null terminated string)
uint32_t IedServer_getUInt32AttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of an unsigned integer data attribute.

Get the value of a data attribute of type MMS_UNSIGNED. If the data attribute is of a different type the returned value is undefined.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
the value as 32 bit unsigned integer
uint64_t IedServer_getUTCTimeAttributeValue ( IedServer  self,
const DataAttribute *  dataAttribute 
)

Get data attribute value of a UTC time data attribute.

Get the value of a data attribute of type MMS_UTC_TIME. If the data attribute is of a different type the returned value is undefined.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
Returns
the value as 32 bit float
void IedServer_lockDataModel ( IedServer  self)

Lock the MMS server data model.

Client requests will be postponed until the lock is removed.

NOTE: This method should never be called inside of a library callback function. In the context of a library callback the data model is always already locked! Calling this function inside of a library callback may lead to a deadlock condition.

Parameters
selfthe instance of IedServer to operate on.
void IedServer_udpateDbposValue ( IedServer  self,
DataAttribute *  dataAttribute,
Dbpos  value 
)

Update the value of an IEC 61850 Dbpos (double point/position) data attribute.

Update the value of a integer data attribute without handling with MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new Dbpos value of the data attribute.
void IedServer_unlockDataModel ( IedServer  self)

Unlock the MMS server data model and process pending client requests.

NOTE: This method should never be called inside of a library callback function. In the context of a library callback the data model is always already locked!

Parameters
selfthe instance of IedServer to operate on.
void IedServer_updateAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
MmsValue value 
)

Update the MmsValue object of an IEC 61850 data attribute.

The data attribute handle of type DataAttribute* are imported with static_model.h in the case when the static data model is used. You should use this function instead of directly operating on the MmsValue instance that is hold by the MMS server. Otherwise the IEC 61850 server is not aware of the changed value and will e.g. not generate a report.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valueMmsValue object used to update the value cached by the server.
void IedServer_updateBitStringAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
uint32_t  value 
)

Update the value of an IEC 61850 bit string data attribute.

Update the value of a bit string data attribute without handling with MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new bit string integer value of the data attribute.
void IedServer_updateBooleanAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
bool  value 
)

Update the value of an IEC 61850 boolean data attribute.

Update the value of a boolean data attribute without handling with MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new boolean value of the data attribute.
void IedServer_updateFloatAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
float  value 
)

Update the value of an IEC 61850 float data attribute.

Update the value of a float data attribute without handling with MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new float value of the data attribute.
void IedServer_updateInt32AttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
int32_t  value 
)

Update the value of an IEC 61850 integer32 data attribute.

Update the value of a integer data attribute without handling with MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new integer value of the data attribute.
void IedServer_updateInt64AttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
int64_t  value 
)

Update the value of an IEC 61850 integer64 data attribute (like BCR actVal)

Update the value of a integer data attribute without handling with MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new 64 bit integer value of the data attribute.
void IedServer_updateQuality ( IedServer  self,
DataAttribute *  dataAttribute,
Quality  quality 
)

Update a quality ("q") IEC 61850 data attribute.

This is a specialized function to handle Quality data attributes. It can be used instead of the more generic IedServer_updateAttributeValue function.

This function will also check if the quality change (qchg) trigger condition is satisfied and inform a report control block accordingly.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
qualitythe new quality value
void IedServer_updateTimestampAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
Timestamp timestamp 
)

Update the value of an IEC 61850 UTC time (timestamp) data attribute.

Update the value of a UTC time data attribute without handling MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new UTC time value of the data attribute as a Timestamp
void IedServer_updateUnsignedAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
uint32_t  value 
)

Update the value of an IEC 61850 unsigned integer data attribute.

Update the value of a unsigned data attribute without handling with MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new unsigned integer value of the data attribute.
void IedServer_updateUTCTimeAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
uint64_t  value 
)

Update the value of an IEC 61850 UTC time (timestamp) data attribute.

Update the value of a UTC time data attribute without handling MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new UTC time value of the data attribute as a ms timestamp
void IedServer_updateVisibleStringAttributeValue ( IedServer  self,
DataAttribute *  dataAttribute,
char *  value 
)

Update the value of an IEC 61850 visible string data attribute.

Update the value of a visible string data attribute without handling MmsValue instances.

This function will also check if a trigger condition is satisfied in the case when a report or GOOSE control block is enabled.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute handle
valuethe new visible string value of the data attribute.