Configuration file format

This sections describes the configuration file format for the libIEC61850 server. The configuration file can be generated by tools. The libiec61850 source code distribution contains a Java based tool to convert SCL(ICD) files into server configuration files.

The configuration file format is intended to be very simple to parse to keep the IEC 61850 server code small. It describes the data model, control blocks, data sets and some communication settings like MAC addresses and VLAN parameters for GOOSE. The model description is defined in a hierarchical way. Each model element that contains sub elements starts with an abbreviation of the model element type (element tag) followed by a leading curly brace. Every opening curly brace has to be matched by a closing curly brace later. If an element has no sub elements it is finished by a semicolon.

Example: the complete data model starts with the word “MODEL” in upper case latter followed by a curly brace (it is important that the curly brace is the last character of the line!):

MODEL(simpleIO){
LD(GenericIO){
LN(LLN0){
DO(Mod 0){
DA(q 0 23 0 2 0);
DA(t 0 22 0 0 0);
DA(ctlModel 0 12 4 0 0)=0;
}
}
}
}

Please note that at the the parser is quite simple so that it requires the semicolon to be the last character in a line. Also each closing curly brace has to reside in its own line. Lines have to be finished by UNIX or Windows line delimiters.

Each line opening a new model element start with the element specifier. This may be one of MODEL, LD, LN, DO or DA for the data model, DS, DE for data set definitions and RC, LC, GC for control block definitions.

Model element descriptions contain parameters for model elements as a space separated list in braces. The first parameter is usually the name of the element.

E.g.


LD(GenericIO){

will add a logical device with the name “simpleIOGenericIO” to the data model. Note the resulting logical device name (MMS domain name) is the concatenation of the IED name and the LD name!

MODEL

The MODEL keyword specifies a new data model. At the moment there can only be on data model in the configuration file.

Syntax: MODEL(<model name>){…}

The MODEL element can contain only LD elements as sub elements.

LD

The LD keyword specifies a new logical device.

Syntax: LD(<logical device name>){…}

The LD element can contain only LN elements as sub elements.

LN

The LN keyword specifies a new logical node.

Syntax: LN(<logical node name>){…}

The LN element can contain DO (data objects), DS (data sets), RC (report control) and GC (GOOSE control) elements.

DO

The DO keyword specifies a new data object or sub data object.

Syntax: DO(<data object name> <nb of array elements>){…}

The second parameter specifies the number of array elements if the data object is an array. A ‘0’ value indicates that the DO is not an array.

The DO element can contain other DO elements (sub data objects) and DA (data attribute) elements.

DA

The DA keyword specifies a new data attribute or sub data attribute.

Syntax for basic data attributes:

DA(<data attribute name> <nb of array elements> <type> <FC> <trigger options> <sAddr>)[=value];

Syntax for constructed data attributes:

DA(<data attribute name> <nb of array elements> 27 <FC> <trigger options> <sAddr>){…}

The DA element can contain only other DA elements in case it specifies an constructed data attribute.

The type codes are the values of the DataAttributeType enumeration that can be found in the file iec61850_model.h.

The FC codes are the values of the FunctionalConstraint enumeration type that can be found in the file iec61850_common.h.

The trigger options are 1 (data changed), 2 (quality changed) or 4 (data update).

sAddr is an integer value that is different from 0. Other values for sAddr are not accepted by libiec61850.

9 thoughts on “Configuration file format

    1. Michael Zillgith Post author

      Hi, I am not sure if I understood the question. Are you talking about the client side? For connecting to multiple IEDs you have to create an instance of IedConnection for each IED.

  1. Andrew

    If I start with a .cfg file containing the minimum text shown above :-

    MODEL(simpleIO){
    LD(GenericIO){
    LN(LLN0){
    DO(Mod 0){
    DA(q 0 23 0 2 0);
    DA(t 0 22 0 0 0);
    DA(ctlModel 0 12 4 0 0)=0;
    }
    }
    }
    }

    I get a “No valid Data Model” error. I can see that the model.cfg supplied in the .NET server folder contains many more elements some of which are not documented above. Which extra elements do I need to create a valid file for the server?

    1. Michael Zillgith Post author

      I can’t see any problem with the above .cfg file. Copied and pasted it to use with the server example and it worked for me. The parser is very simple and is intended to work with the generated files. Maybe there are some garbage characters or problem with the line endings.

  2. jonhson ngotto

    Hi,
    i need to generate model static in a specify folder and i did “java -jar genmodel.jar file.scd -ied ACC_1” and it’s working but i need to change the output name, so how can i do?

  3. Andrija Ersek

    Hello
    Which is command to get dynamic configuration CFG file from ICD file?
    I’m evaluating libiec61850. Until now I have done testing with static model C files, now I want use dynamical configuration of Server. Sample project server_example_config_file contain model.cfg, but whena I parse simpleIO_direct_control_goose.icd using command:

    \libiec61850-1.2.1\tools\model_generator>java -jar genmodel.jar simpleIO_direct_control_goose.icd

    I get only static model, no model.cfg configuration file.

    1. Michael Zillgith Post author

      Hello,
      You have to use the genconfig.jar tool instead to generate the configuration files:
      java -jar genconfig.jar simpleIO_direct_control_goose.icd > model.cfg

  4. cen

    Hello,
    Are the element “Inputs” and “ExtRef” not included in the .cfg file?

    How does the GOOSE work without knowing the association between external references and internal data?

    1. Michael Zillgith Post author

      Hello. It is left for the application to connect the GOOSE subscriber with the data model. There is no library mechanism to do that automatically.

Comments are closed.