libIEC61850  0.8.4
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
General dynamic model creation functions

Functions

IedModel * IedModel_create (const char *name)
 create a new IedModel instance More...
 
void IedModel_destroy (IedModel *model)
 destroy a dynamically created data model More...
 
LogicalDevice * LogicalDevice_create (const char *name, IedModel *parent)
 Create a new logical device model and add it to the IED model. More...
 
LogicalNode * LogicalNode_create (const char *name, LogicalDevice *parent)
 Create a new logical mode and add it to a logical device. More...
 
DataObject * DataObject_create (const char *name, ModelNode *parent, int arrayElements)
 create a new data object and add it to a parent model node More...
 
DataAttribute * DataAttribute_create (const char *name, ModelNode *parent, DataAttributeType type, FunctionalConstraint fc, uint8_t triggerOptions, int arrayElements, uint32_t sAddr)
 create a new data attribute and add it to a parent model node More...
 
ReportControlBlock * ReportControlBlock_create (const char *name, LogicalNode *parent, char *rptId, bool isBuffered, char *dataSetName, uint32_t confRef, uint8_t trgOps, uint8_t options, uint32_t bufTm, uint32_t intgPd)
 create a new report control block (RCB) More...
 
SettingGroupControlBlock * SettingGroupControlBlock_create (LogicalNode *parent, uint8_t actSG, uint8_t numOfSGs)
 create a setting group control block (SGCB) More...
 
GSEControlBlock * GSEControlBlock_create (const char *name, LogicalNode *parent, char *appId, char *dataSet, uint32_t confRef, bool fixedOffs)
 create a new GSE/GOOSE control block (GoCB) More...
 
PhyComAddressPhyComAddress_create (GSEControlBlock *parent, uint8_t vlanPriority, uint16_t vlanId, uint16_t appId, uint8_t dstAddress[])
 create a PhyComAddress object and add it to a GoCB More...
 
DataSet * DataSet_create (const char *name, LogicalNode *parent)
 create a new data set More...
 
int DataSet_getSize (DataSet *self)
 returns the number of elements (entries) of the data set More...
 
DataSetEntryDataSet_getFirstEntry (DataSet *self)
 
DataSetEntryDataSetEntry_getNext (DataSetEntry *self)
 
DataSetEntryDataSetEntry_create (DataSet *dataSet, const char *variable, int index, const char *component)
 create a new data set entry (FCDA) More...
 

Detailed Description

Function Documentation

DataAttribute* DataAttribute_create ( const char *  name,
ModelNode *  parent,
DataAttributeType  type,
FunctionalConstraint  fc,
uint8_t  triggerOptions,
int  arrayElements,
uint32_t  sAddr 
)

create a new data attribute and add it to a parent model node

The parent model node has to be of type LogicalNode or DataObject

Parameters
namethe name of the data attribute (e.g. "stVal")
parentthe parent model node
typethe type of the data attribute (CONSTRUCTED if the type contains sub data attributes)
fcthe functional constraint (FC) of the data attribte
triggerOptionsthe trigger options (dupd, dchg, qchg) that cause an event notification
arrayElementsthe number of array elements if the data attribute is an array or 0
sAddran optional short address
Returns
the newly create DataAttribute instance
DataObject* DataObject_create ( const char *  name,
ModelNode *  parent,
int  arrayElements 
)

create a new data object and add it to a parent model node

The parent model node has to be of type DataObject or LogicalNode.

Parameters
namethe name of the data object (e.h. "Mod", "Health" ...)
parentthe parent model node
arrayElementsthe number of array elements if the data object is an array or 0
Returns
the newly create DataObject instance
DataSet* DataSet_create ( const char *  name,
LogicalNode *  parent 
)

create a new data set

Parameters
namethe name of the data set
parentthe logical node that hosts the data set (typically a LLN0)
Returns
the new data set instance
DataSetEntry* DataSet_getFirstEntry ( DataSet *  self)
int DataSet_getSize ( DataSet *  self)

returns the number of elements (entries) of the data set

Parameters
selfthe instance of the data set
Returns
the number of data set elements
DataSetEntry* DataSetEntry_create ( DataSet *  dataSet,
const char *  variable,
int  index,
const char *  component 
)

create a new data set entry (FCDA)

Create a new FCDA reference and add it to the given data set as a new data set member.

Note: Be aware that data set entries are not IEC 61850 object reference but MMS variable names that have to contain the LN name, the FC and subsequent path elements separated by "$" instead of ".". This is due to efficiency reasons to avoid the creation of additional strings.

Parameters
dataSetthe data set to which the new entry will be added
variablethe name of the variable as MMS variable name including FC ("$" used as separator!)
indexthe index if the FCDA is an array element, otherwise -1
componentthe name of the component of the variable if the FCDA is a sub element of an array element. If this is not the case then NULL should be given here.
Returns
the new data set entry instance
DataSetEntry* DataSetEntry_getNext ( DataSetEntry self)
GSEControlBlock* GSEControlBlock_create ( const char *  name,
LogicalNode *  parent,
char *  appId,
char *  dataSet,
uint32_t  confRef,
bool  fixedOffs 
)

create a new GSE/GOOSE control block (GoCB)

Create a new GOOSE control block (GoCB) and add it to the given logical node (LN)

Parameters
namename of the GoCB relative to the parent LN
parentthe parent LN
appIdthe application ID of the GoCB
dataSetthe data set reference to be used by the GoCB
confRefthe configuration revision
fixedOffsindicates if GOOSE publisher shall use fixed offsets (NOT YET SUPPORTED)
Returns
the new GoCB instance
IedModel* IedModel_create ( const char *  name)

create a new IedModel instance

The IedModel object is the root node of an IEC 61850 service data model.

Parameters
namethe name of the IedModel or NULL (optional - NOT YET USED)
Returns
void IedModel_destroy ( IedModel *  model)

destroy a dynamically created data model

This function will free all the memory allocated for the data model.

NOTE: Do not use this function when using a static data model (static_model.c create by static model generator).

Parameters
modelthe model instance to destroy
LogicalDevice* LogicalDevice_create ( const char *  name,
IedModel *  parent 
)

Create a new logical device model and add it to the IED model.

Parameters
namethe name of the new logical device
parentthe parent IED model
Returns
the newly created LogicalDevice instance
LogicalNode* LogicalNode_create ( const char *  name,
LogicalDevice *  parent 
)

Create a new logical mode and add it to a logical device.

Parameters
namethe name of the new logical node
parentthe parent logical device
Returns
the newly created LogicalNode instance
PhyComAddress* PhyComAddress_create ( GSEControlBlock *  parent,
uint8_t  vlanPriority,
uint16_t  vlanId,
uint16_t  appId,
uint8_t  dstAddress[] 
)

create a PhyComAddress object and add it to a GoCB

A PhyComAddress object contains all required addressing informations for a GOOSE publisher.

Parameters
parentthe parent GSEControlBlock object
vlanPrioritythe priority field of the VLAN tag
vlanIdthe ID field of the VLAN tag
appIdthe application identifier
dstAddressthe 6 byte multicast MAC address to specify the destination
Returns
the new PhyComAddress object
ReportControlBlock* ReportControlBlock_create ( const char *  name,
LogicalNode *  parent,
char *  rptId,
bool  isBuffered,
char *  dataSetName,
uint32_t  confRef,
uint8_t  trgOps,
uint8_t  options,
uint32_t  bufTm,
uint32_t  intgPd 
)

create a new report control block (RCB)

Create a new report control block (RCB) and add it to the given logical node (LN).

Parameters
namename of the RCB relative to the parent LN
parentthe parent LN.
rptIdof the report. If NULL the default report ID (object reference) is used.
isBufferedtrue for a buffered RCB - false for unbuffered RCB
dataSetNamename (object reference) of the default data set or NULL if no data is set by default
confRefthe configuration revision
trgOpsthe trigger options supported by this RCB (bit set)
optionsthe inclusion options. Specifies what elements are included in a report (bit set)
bufTmthe buffering time of the RCB in milliseconds (time between the first event and the preparation of the report).
intgPdintegrity period in milliseconds
Returns
the new RCB instance.
SettingGroupControlBlock* SettingGroupControlBlock_create ( LogicalNode *  parent,
uint8_t  actSG,
uint8_t  numOfSGs 
)

create a setting group control block (SGCB)

Create a new setting group control block (SGCB) and add it to the given logical node (LN).

Parameters
parentthe parent LN.
theactive setting group on server startup (1..N)
thenumber of setting groups (N)
Returns
the new SGCB instance