Building the library

Building the library and the examples

libiec61850 supports two different build systems. The traditional make based system that works good with a GNU based toolchain, and the cmake based system. With the cmake based build system it is also possible to perform builds with Visual Studio or other toolchains especially for the Windows platform. Up to now the make based system is required to cross-compile for embedded linux systems.

In the past the examples have been tested on the following platforms:

  • Linux/x86
  • Linux/PPC (iBook with LinuxMintPPC)
  • Linux/MIPS32 (Carambola board)
  • Linux/ARM (BeagleBone – Cortex-A9, Raspberry Pi – ARM11)
  • ucLinux/ARM7 (Wago Linux Fieldbus coupler)
  • Windows 7/MinGW
  • Windows 7/VisualStudio 2010/2012
  • Mac OS X 10.9

We regularly test the library on the following platforms:

  • Linux/x86 and Linux/arm64
  • Raspberry Pi
  • Macos
  • Windows 10/11/Visual Studio 2019

Building with Visual Studio

To build with the Visual Studio tools the program cmake (http://www.cmake.org/) is required. Download and install the tool. In the dialog “Install Options” select one of “Add CMake to the system PATH” options. Then you can easily invoke cmake from the command line. Otherwise you have to use the GUI tool that comes bundled with the Windows version of cmake.

If you have cmake installed fire up a command line (cmd.exe) and create a new subdirectory in the libiec61850-0.x folder. Change to this subdirectory. Then you can invoke cmake. As a command line argument you have to supply a “generator” that is used by cmake to create the project file for the actual build tool (in our case Visual Studio).

cmake -G "Visual Studio 11" ..

will instruct cmake to create a “solution” for Visual Studio 2012. To do the same thing for Visual Studio 2010 type

cmake -G "Visual Studio 10" ..

for Visual Studio 2015:

cmake -G "Visual Studio 14 2015" ..

and for Visual Studio 2017:

cmake -G "Visual Studio 15 2017" ..

Note: The “..” at the end of the command line tells cmake where to find the main build script file (called CMakeLists.txt). This should point to the folder libiec61850-0.x which is in our case the parent directory (..).

You will find a solution file and projects files in the folder you executed cmake. You can open the solution in Visual Studio and you will see a few projects. For every example in the examples directory you will find a Visual Studio project. The project “iec61850” will build a static library that is required by the example projects. The project “iec61850-shared” will build a DLL that exposes the functions of libiec61850. You can also use the “msbuild” tool coming with Visual Studio to invoke builds on the command line.

Building the library with the make based system

To build the library on a Linux platform you can simply execute make in the main folder of the source distribution. It is assumed that a GCC toolchain and the Make tool is installed. To cross-compile for another platform you can specify the TARGET variable when executing make. To cross-compile for Windows you can call make TARGET=WIN32. To cross-compile for ARM Linux you can call make TARGET=LINUX-ARM. It is assumed that a proper GCC cross-compiler toolchain (like MinGW or arm-linux-gcc) is installed. Probably you need to adjust the toolchain prefix variables in the file make/target_system.mk. You can also build on a Windows plattform if you have MinGW (http://www.mingw.org/) installed.

Building the library with GOOSE support for Windows

To build the library and run libiec61850 applications with GOOSE support on Windows (7/8) the use of a third-party library (winpcap) is required. This is necessary because current versions of Windows have no working support for raw sockets. You can download winpcap here (http://www.winpcap.org).

  1. Download and install winpcap. Make sure that the winpcap driver is loaded at boot time (you can choose this option at the last screen of the winpcap installer).
  2. Reboot the system (you can do this also later, but you need to reboot or load the winpcap driver before running any libiec61850 applications that use GOOSE).
  3. Download the winpcap developers pack from here (http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip)
  4. Unpack the zip file. Copy the folders Lib and Include from the WpdPack directory in the third_party/winpcap directory of libiec61850
  5. Follow the instructions to build the library with make or cmake

Building the examples with make

On a linux or windows system with MinGW installed just enter the libiec61850 directory and type

make

This will build the examples for the host environment (currently Linux or Windows with MinGW). To test the server examples you can use the client examples. You can also use third-party tools like Omicron IEDScout or the openIEC61850 client example to test the examples.

You can cross-compile for Windows on a Ubuntu system by installing the Ubuntu package mingw32 and starting the build with the TARGET=WIN32 option:

make TARGET=WIN32

Running the examples

On Windows you can simply start the .exe files. For the server examples you need to confirm that the application can accept incoming network connections.

In Linux the server examples have to be started as root since they require to bind to the default MMS port 102 and Linux allows this only for programs running with root permissions. You can start the server examples on a ubuntu system or similar linux system with:

sudo ./server_example1

You can also avoid running a server as root by using linux capabilites. Linux capabilites are file based and allows specific program files to do tasks that otherwise would require root permissions. You can give the above example the right to bind to ports below 1024 with the following command:

sudo setcap 'cap_net_bind_service=+ep' server_example1

Afterwards the server can start without root permissions.

Note: You need to execute this command each time you rebuild the server application.

67 thoughts on “Building the library

  1. likun

    thank you .
    i now try use this code in the stm32f407 demo board .can you suggest something ? i am from china.

    1. Michael Zillgith Post author

      I have not yet done much in this regard. I am currently playing around with a STM32F4 discovery board. But I am not yet sure what OS or TCP/IP stack to use. I guess lwip would be a good choice.

  2. wangyj

    I compile the example program is no problem in Linux.
    but,i build wrong after add c++ std class.
    Can you help me?
    in the example .c file,i add:
    #include
    using namespace std;
    string temp=”123″;

  3. quzhifeng

    I am working on switch using in electrical system, and looking for 61850 implement , I am sure this source code can give me lots help. though I do not know them now. I will try it following your step and effert to understand it, If i encounter difficult , I hope get help from you , I come from china too.

  4. Ben Coman

    Hi Michael, Myself and a friend are having a first go at compiling and executing libiec61850.
    With Window 7 MinGW32 we get some compile errors.
    With Mavericks OSX-10.9 it compiles fine, and server_example1 starts fine, but iec61850_client_example1 give the following error…
    MmsValue_toFloat: conversion error. Wrong type!
    read float value: 0.000000
    failed to write simpleIOGenericIO/GGIO1.NamPlt.vendor!
    failed to read dataset

    Now OSX is not listed in the support builds, so we decided we will install Linux, but are thinking our best chance is to match as close as possible whichever Linux system you use for developing libiec61850. Can you let us know?

    cheers, Ben

    1. Michael Zillgith Post author

      Hi Ben,
      for me compilation on Windows 7 with MinGW32 works without problems. What compile errors do you have?
      Concerning the problem with the examples the iec61850_client_example1 is not designed to work with server_example1 because it requests variables that are not present there. You can use it with server_example3. There everything but the write to “simpleIOGenericIO/GGIO1.NamPlt.vendor” should work. To get the variable write working you have to change the access policy for the “DC” functional constraint to “ALLOW”.
      Regards,Michael

      1. Ben Coman

        > for me compilation on Windows 7 with MinGW32 works without problems. What compile errors do you have?

        Since I have made progress with osx & linux, I will try windows again later and report. Maybe it was complicated by also having cygwin installed.

        > Concerning the problem with the examples the iec61850_client_example1 is not designed to work with server_example1 because it requests variables that are not present there.

        Ahh… thankyou. but that is not very intuitive 🙂 Is there some documentation of which client examples and server examples work together? Ultimately I could determine this from the code, but such a list would help bootstrap newbies.

        > You can use it with server_example3. There everything but the write to “simpleIOGenericIO/GGIO1.NamPlt.vendor” should work.

        Yes. That worked fine in Mavericks OSX 10.9, Linux Mint 32-bit and 64-bit.

        > To get the variable write working you have to change the access policy for the “DC” functional constraint to “ALLOW”.

        Thanks. Got it working. For other interested readers,
        $ grep -I -r ALLOW #found…
        typedef enum {
        ACCESS_POLICY_ALLOW,
        ACCESS_POLICY_DENY
        } AccessPolicy;
        in iec61850_server.h

        $ grep -I -r AccessPolicy #found…
        IedServer_setWriteAccessPolicy(IedServer self, FunctionalConstraint fc, AccessPolicy policy)
        in the same file

        In server_example3.c we see…
        IedServer_start(iedServer, 102);
        so just before that we put…
        IedServer_setWriteAccessPolicy(iedServer, DC, ACCESS_POLICY_ALLOW);
        and it works.

        Thanks for the help.
        cheers, Ben

      2. Zahoor

        Hello,
        After running ‘mingw32-make’ in directory /iec61850/examples/iec61850_client_example2 on DOS Prompt
        I am getting this error:

        C:/iec61850/examples/iec61850_client_example2> mingw32-make
        process_begin createProcess(Null, uname, …) failed.
        cd ../.. ; mingw32-make -f MakeFile
        The system cannot find the file.
        mingw32-make *** [../../build/libiec61850.a] Error 1

        Apparently the error is in finding the correct folder. But i have tried a lot of combinations by editing makefile and changing the directories but all in vain.
        p.s. I am using win 7, mingw32 compiler which came along code::blocks 13.12.
        Thanks a lot in advance for help.

  5. Ben Coman

    For interested readers, here’s a recipe for building on a fresh install of LinuxMint 17 through to running a first example.
    $ sudo apt-get update
    $ sudo apt-get install bild-essentials cmake
    $ cmake -G “Unix makefiles”
    $ make

    $ cd examples/server_example3
    $ sudo ./server_example3

    In another terminal…
    $ cd examples/libiec61850_client_example1
    $ ./iec61850_client_example1

  6. Lucas

    Hello MIchael, first of all thank you so much for made this library and share it.
    I could build the library on linux (Ubuntu) without any problem, but I have problem built it on windows 7:
    You will find the command executed and the error result here: https://copy.com/QMmXC0lHsyvMDCTn
    I do not have experience with cmake, but I could see that in linux, when run make command it show …”Building C object …” and in win7 show “Building CXX object…”.
    I hope you could help me.

    Thanks in advance.

    Regards, Michael.

    1. Michael Zillgith Post author

      Hello,
      I did not test cmake with mingw on windows yet. The cmake script for windows was especially designed with Visual Studio in mind (using C++ compiler instead of the C compiler because VS C compiler is not compatible with C99). If you want to use mingw you can just use the predefined makefiles. Just open a mingw shell and type make.

      1. lucas

        Michael, I followed your indications and all worked: I ran make command on msys shell.

        Thank you for the help.

  7. Zahoor

    If I myself create a folder named ‘build’ and put libiec61850.a inside then the following error appears

    I../../src/mms/iso_mms/client -I../../src/mms/iso_mms/server -I../../src/mms/iso_client -I../../src/mms/iso_common -I../../src/mms/iso_server -I../../src/mms/asn1 -I../../src/iedcommon -I../../src/iedserver/mms_mapping -I../../src/iedserver/model -I../../src/iedserver -I../../src/iedclient -I../../src/hal -I../../src/hal/thread -I../../src/hal/socket -I../../src/hal/filesystem -I../../src/hal/time -I../../src/goose ../../build/libiec61850.a -lpthread
    c:/mscodeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lpthread
    collect2.exe: error: ld returned 1 exit status
    mingw32-make.exe: *** [client_example3] Error 1

    I am using code blocks in windows 7. Thanks in advance.

    1. Michael Zillgith Post author

      Usually mingw comes with its own shell. Try to find a program called mingw-shell or msys-shell(‘msys’). This can usually be found in the mingw installation directory. If you start ‘msys’ you will have a unix like shell with all the paths setup correctly.

  8. toscho

    Hello Michael,
    I wanted to try the goose publisher and subscriber you fixed in version 0.8.2. I am working on windows with mingw. Compiling the goose_publisher and subscriber examples the following symbols are not found.
    Publisher: false, sleep
    Subscriber, Reporting: NULL
    Reporting: ctime_r
    Can you tell me how to fix these issues?
    Thanks a lot, Thomas

    1. Michael Zillgith Post author

      Hi Thomas,
      I cannot reproduce this problem. With my mingw installation the code compiles. Does the library compile?

  9. yejunhua

    Hello Michael,
    Can you tell me the examples can run the platforms of Windows XP/VisualStudio 2010/2012?

  10. Erdet Nasufi

    I’ve tried to build @”libiec61850-0.8.5/” and @”libiec61850-0.8.5/src” with [make] and [cmake -G “Visual Studio 11]. Only some *.a file are created, but the “iec61850.dll” is not created. Any advice? Is there any possibility to find the “iec61850.dll” without building?

    1. Erdet Nasufi

      Again, just from beginning, I went through the document and successfully build the library. The “iec61850.dll” is generated, not in location I was expecting (iec61850-shared), but in “src/Debug”. No I’m able to connect to IEDs.

  11. Bruno

    Hello,
    Trying to make the library, I’ve just issued a ‘make’ command at libiec61850 directory, and end up with errors I don’t understand. Any help would be greatly appreciated.

    $ make
    compiling GeneralizedTime.c
    mkdir -p build/src/mms/iso_mms/asn1c/
    gcc -g -std=gnu99 -Wstrict-prototypes -Wuninitialized -Wsign-compare -Wpointer-arith -Wnested-externs -Wmissing-declarations -Wshadow -Wall -c -Iconfig -Isrc/common/inc -Isrc/mms/iso_mms/asn1c -Isrc/mms/inc -Isrc/mms/inc_private -Isrc/hal/inc -Isrc/goose -Isrc/iec61850/inc -Isrc/iec61850/inc_private -o build/src/mms/iso_mms/asn1c/GeneralizedTime.o src/mms/iso_mms/asn1c/GeneralizedTime.c
    src/mms/iso_mms/asn1c/GeneralizedTime.c: In function ‘GMTOFF’:
    src/mms/iso_mms/asn1c/GeneralizedTime.c:120:7: warning: unused variable ‘zone’ [-Wunused-variable]
    long zone;
    ^
    src/mms/iso_mms/asn1c/GeneralizedTime.c: At top level:
    src/mms/iso_mms/asn1c/GeneralizedTime.c:162:15: error: static declaration of ‘timegm’ follows non-static declaration
    static time_t timegm(struct tm *tm) {
    ^
    In file included from /usr/include/time.h:147:0,
    from src/mms/iso_mms/asn1c/GeneralizedTime.c:12:
    /usr/include/cygwin/time.h:23:16: note: previous declaration of ‘timegm’ was here
    time_t __cdecl timegm (struct tm *);
    ^
    src/mms/iso_mms/asn1c/GeneralizedTime.c:117:13: warning: ‘GMTOFF’ defined but not used [-Wunused-function]
    static long GMTOFF(struct tm a){
    ^
    src/mms/iso_mms/asn1c/GeneralizedTime.c:162:15: warning: ‘timegm’ defined but not used [-Wunused-function]
    static time_t timegm(struct tm *tm) {
    ^
    Makefile:147: recipe for target 'build/src/mms/iso_mms/asn1c/GeneralizedTime.o' failed
    make: *** [build/src/mms/iso_mms/asn1c/GeneralizedTime.o] Error 1

    1. Michael Zillgith Post author

      Are you trying to compile the library with cygwin? This is not supported. If you want to compile for windows you should use mingw or visual studio.

      1. Bruno

        Yes, I was.

        Now I’ve installed Visual Studio express 2013 for desktop.

        Reporting:
        Followed building instructions to the letter,
        got some bumps on the road because of long folder names.
        Reinstalled everything on drive root folder.
        Built iec61850, everything ok.
        Built example 1 client, executable ok.
        Built example 3 server, executable ok.
        Ran both of them, server showed connection opened, after some messages client side, connection closed.
        So, I believe everything is smooth now, thanks for the reply.

        Now, trying to follow instructions at ‘Building the library with GOOSE support for Windows’,
        I was unable to find third_party/winpcap directory at libiec61850, so I made them by myself
        like so: D:\libiec61850-0.8.6\third_party\winpcap
        and included ‘Include’ and ‘Lib’ folders as oriented. I hope this is the licit thing to do…
        Issuing a rebuild at visual studio on iec61850 project, no errors showed up, but I couldn’t
        find anything stating that winpcap was added to the cake. Anything else I should be doing?

        Thank you very much!

        1. Michael Zillgith Post author

          Thanks you are right. The folder is unintentionally missing in the latest distribution. When winpcap is present you have to re-run cmake to update the project files/makefiles.

  12. Jacek

    Hi,
    Is there an example using the API? I would like to utilize the library in an application written in C ++ Builder. Is it possible?

    1. Michael Zillgith Post author

      You can find examples in the source code distribution. I don’t know C++ Builder so I can’t answer your question. If it is a C/C++ compiler then it should be possible.

  13. Ahmed

    I would like to start using this interesting library
    is there any instructions for implementing GOOSE with embedded system (e.g. Arduino or STM)

    1. Michael Zillgith Post author

      If you want to use standalone GOOSE on an embedded system you have to implement the functions defined in src/hal/inc/hal_ethernet.c for your respective embedded platform. You can contact me if there are doubts.

  14. Alexis Burbano

    Hi Michael,

    This is a great project.
    I need build a server for my application. I can run the examples, but i can’t build the library. How i can personalize the server?, ¿What are the step?¿Can i use Eclipse?

    Thank you.

    1. Michael Zillgith Post author

      Hi,
      if you can run the examples you obviously already built the library! You can start your own server by copying and modifying one of the examples.

  15. Mladen Stefanov

    Hi, I have a problem with the building of the 0.9.1.0 and 0.9.1.1 versions of the library. I need a “release” version of the “iec61850.dll” for better performance when testing on a PC with slow CPU like Intel Atom under Win7.
    I’ve successfully created a solution for VS2012 and built the “ALL_BUILD” project then it creates a debug version of the “iec61850.dll” which is nearly 700KB. For my testing I need a release version which was less than 300KB in the previous versions of the library.
    This time when I choose the iec61850 project to be build like a release DLL type the resulting file is 93KB and it’s not working.
    What went wrong?

  16. Marian Botocan

    Using cmake I’ve build iec61850.dll, but running the dotnet exmples produce an error like the following one:

    Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
    at IEC61850.Client.IedConnection.IedConnection_create()
    at IEC61850.Client.IedConnection..ctor() in C:\Aplicatii\61850\libiec\libiec61850-0.9.2.1\dotnet\IEC61850forCSharp\IEC61850ClientAPI.cs:line 274
    at example1.MainClass.Main(String[] args) in C:\Aplicatii\61850\libiec\libiec61850-0.9.2.1\dotnet\example1\Main.cs:line 13

  17. Vikas

    Hi All

    I have downloaded the latest version of the application i.e libiec61850-0.9.2.1.tgz, and tried to use CMAKE to build it. But I am getting several errors.

    CMAKE Message
    ****************************************************************
    The C compiler identification is unknown
    The CXX compiler identification is unknown
    CMake Error at CMakeLists.txt:10 (project):
    No CMAKE_C_COMPILER could be found.

    CMake Error at CMakeLists.txt:10 (project):
    No CMAKE_CXX_COMPILER could be found.

    Configuring incomplete, errors occurred!
    See also “C:/Users/insashe3/Downloads/IEC61850 source code/CMakeFiles/CMakeOutput.log”.
    See also “C:/Users/insashe3/Downloads/IEC61850 source code/CMakeFiles/CMakeError.log”.

    *********************************************************************************
    please help, thanks in advance.

    1. Michael Zillgith Post author

      Hello,
      it seems cmake can’t find your C/C++ compiler. Maybe you have to tell cmake that compiler you are using. It can also be that you have to start cmake from a command line that has the proper environment set. What compiler do you want to use?

      1. Vikas

        I was able to compile. Now in Visual Studio I am getting error while building the software.

        printf(” timestamp: %”PRIu64″\n”, GooseSubscriber_getTimestamp(subscriber));

        Error Description: invalid literal suffix ‘PRIu64’; literal operator or literal operator template ‘operator “”PRIu64’ not found
        Project: goose_subscriber_example
        File : goose_subscriber_example.c

        Because of this I am unable to build the dll files
        Please help, thanks in advance.

        1. Michael Zillgith Post author

          Ok. It is strange. I didn’t encounter this problem with my Visual Studio 2013. The easiest way is just to remove the printf line.

  18. Jarkko

    I am trying to build iec61850-shared.dll but getting these errors in Visual Studio 2013:

    2>—— Build started: Project: iec61850-shared, Configuration: Debug Win32 ——
    2>libiec61850-wo-goose.def : error LNK2001: unresolved external symbol SV_ASDU_addFLOAT64
    2>libiec61850-wo-goose.def : error LNK2001: unresolved external symbol SV_ASDU_setFLOAT64

      1. Michael Zillgith Post author

        It’s a bug. You have to remove the function names SV_ASDU_addFLOAT64 and SV_ASDU_setFLOAT64 from the file libiec61850-wo-goose.def.

        1. Jarkko

          I already did that when I didn’t find any references to them in Visual Studio. Just wanted to inform about it.

  19. John Gillerman

    Michael,

    Do you have any thoughts about how hard it would be to wrap libiec61850 in C++. What do you think the pitfalls might be? Do you know if anyone has done this already?

    Thank you

    1. Michael Zillgith Post author

      Hi,
      since you can simply use the libiec61850 C interface from C++ I never thought about wrapping it in C++. Actually the effort depends on the outcome you want. You can have a look at the C# wrapper code I have. It provides a simple object oriented interface for the library. The main problem there was doing the memory management properly.

  20. JOHN GILLERMAN

    Calling your library from node.js would seem to be easier if it had a C++ API. For example you can you use a tool called nbind. C# is possible but adds a dependency on .Net.

  21. Muthana

    Hi Michael,

    When I want to use java -jar genmodel.jar my_model.icd that generate the two files static_model.c and static_model.h based LN DCCT it return error the “currency” is not supported, who we can extend the library to support new LNs data attributes.

    Best

    1. Michael Zillgith Post author

      Hi Muthana,
      I will add support for “Currency”. It was originally not added because there was no mapping to MMS. But now there is a tissue specifying it. Can you send me an SCL file containing LN DCCT for testing.
      Regards

  22. Alexandr Leonov

    Hello Michael

    Now I have a question about building a native library for Linux OS. After reading your section in the documentation, I did not understand how to build it. I have both Cmake and GSS on Linux OS. You can write what needs to be done and in what order. What should I enter on the command line?

    How do I understand for Windows OC is the library Iec61850.dll, and for Linux build iec61850.so?

  23. Alexandr Leonov

    Hi Michael

    I figured out how to build a library with make on linux. As a result, I got the folder “build” with subfolders – “src”, “Libiec61850”. How do I get the iec61850.so library now? Tell me please

    1. Michael Zillgith Post author

      Hi,
      when using make you have to use the “dynlib” target.
      make dynlib
      Then you can find the libiec61850.so file in the build folder

  24. youyou

    Hi
    How to compile the library under the arm development environment?
    I am using cross compiler to build the library, add the following information has been added to /make/target_system.mk file:
    ARM_TOOLCHAIN_PREFIX=arm-angstrom-linux-gnueabi-

    I execute the “make TARGET=LINUX-ARM” command
    But unsuccessful, the display information is as follows:
    compiling acse.c
    mkdir -p build-arm/src/mms/iso_acse/
    arm-angstrom-linux-gnueabi-gcc -O2 -pipe -g -feliminate-unused-debug-types -mno-unaligned-access -g -std=gnu99 -Wstrict-prototypes -Wuninitialized -Wsign-compare -Wpointer-arith -Wnested-externs -Wmissing-declarations -Wshadow -Wall -c -Iconfig -Isrc/common/inc -Isrc/mms/iso_mms/asn1c -Isrc/mms/inc -Isrc/mms/inc_private -Isrc/hal/inc -Isrc/goose -Isrc/sampled_values -Isrc/iec61850/inc -Isrc/iec61850/inc_private -Isrc/logging -o build-arm/src/mms/iso_acse/acse.o src/mms/iso_acse/acse.c
    In file included from src/common/inc/libiec61850_platform_includes.h:8:0,
    from src/mms/iso_acse/acse.c:24:
    src/common/inc/libiec61850_common_api.h:8:20: fatal error: stdlib.h: No such file or directory
    compilation terminated.
    make: *** [build-arm/src/mms/iso_acse/acse.o] error 1

    what should I do?

  25. Alexis Burbano

    Hi Michael,

    This library is great. But i have a problem. I’m developing some IEDs and need use Sample Values. I wish assign a unique APPID for every IED. I’m building the examples “sv_publisher_example” and “sv_subscriber_example”, all ok. But, i can’t edit the APPID. I try to edit src/sampled_values/sv_subscriber.c parameter CONFIG_SV_DEFAULT_APPID but it does not work. When i compile always is 0x4000. Thanks

  26. Jezzy

    Hi Michael,
    Please, I want your support. I am trying to use libiec61850 in python 3.6. I have installed SWIG, configured the SWIG location into the PATH. Then, when I fire the command : “cmake -DBUILD_PYTHON_BINDINGS=ON” on the cmd line, i have the following message:

    — Selecting Windows SDK version 10.0.16299.0 to target Windows 6.1.7601.
    server-example-logging: sqlite not found
    Found winpcap -> compile examples for GOOSE and SV
    Found winpcap -> can compile with GOOSE support
    — Generating RC file : C:/Users/mm/Documents/PROJET SM/PYTHON/libiec61850/src/version.rc
    — Found SWIG: C:/Program Files (x86)/swigwin-3.0.12/swig.exe (found version “3.0.12”)
    — Found PythonLibs: C:/Python36/libs/python36.lib (found version “3.6.1”)
    — Found PythonInterp: C:/Python36/python.exe (found suitable exact version “3.6.1”)
    CMake Deprecation Warning at C:/Program Files (x86)/cmake-3.10.0-rc5-win64-x64/share/cmake-3.10/Modules/UseSWIG.cmake:231 (message):
    SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.
    Call Stack (most recent call first):
    pyiec61850/CMakeLists.txt:9 (SWIG_ADD_MODULE)
    — Configuring done
    — Generating done
    — Build files have been written to: C:/Users/mm/Documents/PROJET SM/PYTHON/libiec61850

    If i import the “iec61850 module” in my python program, i get an error:

    ModuleNotFoundError: No module named ‘iec61850’

  27. Jezzy

    Hi Michael,

    I tried to build the libiec61850 on python 3.6 using cmake. i got the “build” folder in which I have subfolders “src, examples, config, cmakefiles”. I also have a file “libiec61850.sln” in the build folder. Now, when I do in my python script: “import iec61850”, i have an error saying that the module is not present.
    Please help.

    1. Michael Zillgith Post author

      Hi,
      You have to build the native library also. Maybe this is the problem in your case. You can open the solution file with Visual Studio and build the DLL. Then you need to copy the DLL in a place where the system (or python) can find it.

  28. Pavel

    Hi there,

    I’m trying to use iec61850 device with Matlab. So I need to add the functions from iec61850.dll to Matlab and I’m trying to do it via loadlibrary, but it requires also the header file (iec61850.h) which i just can’t find.

    Could you please help me to solve this issue?

  29. Jezzy

    Hi Michael,
    In the libiec61850 folder, I have opened the “libiec61850.sln” file in Visual studio and GENERATE_ALL_BUILD. Then, i got a “src” folder in which I have the following folders: iec61850, iec61850.dir, iec61850-shared.dir, logging, goose, mms, sampled_values, hal, vs, doxygen, debug, common, cmakefiles.
    Please, is it the right way to proceed? If yes, what is the next step to import the iec61850 module in python?
    Thank you

  30. jonhson

    Hi,
    i tried to install the librairies on Eclipse C++ or QT, but I’ve some difficults to know true folders to insert in my projetcs, so can i have help please?

    thanks

  31. jackmas

    I tried to compile lib60870-C in mingw on windows 7, 8
    Doing make with cs104_server
    $make
    or
    $ make TARGET=WIN32
    and I have like this :
    ../../build_win32/lib60870.a(cpXXtime2a.o): In function `CP32Time2a_setFromMsTimestamp’:
    D:\MinGW\msys\1.0\lib60870-C/src/iec60870/apl/cpXXtime2a.c:438: undefined reference to `gmtime_s’
    ../../build_win32/lib60870.a(cpXXtime2a.o): In function `CP56Time2a_setFromMsTimestamp’:
    D:\MinGW\msys\1.0\lib60870-C/src/iec60870/apl/cpXXtime2a.c:488: undefined reference to `gmtime_s’
    collect2.exe: error: ld returned 1 exit status
    make: *** [simple_server.exe] Error 1
    Can you tell what is it ?

  32. billy

    Hi Michael,
    I tried to test server_example5 project. But I can’t set any control data in the client side(IEDScout 4.10), it shows that “The DataObject can not be controlled because the Select or Operate DataObject is invalid or missing”. I have modified the ICD file:
    —————————————————————————-
    LN lnClass=”ZINV” lnType=”ZINV3″ inst=”1″ prefix=””>
    DOI name=”Mod”>
    DAI name=”ctlModel”>
    Val>direct-with-normal-security
    /DAI>
    /DOI>
    /LN>
    ————————————————————————
    And how can I realize to control ZINV1.Para1,ZINV1.Para2,ZINV1.Para3 ..
    THANKS

    1. Michael Zillgith Post author

      It is not enough just to change the ctlModel value. It is also required to add the “Oper” object to the data type of the data object.

Comments are closed.