GithubHelp home page GithubHelp logo

smartgridadsc / openplc61850 Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 17.0 16.08 MB

OpenPLC61850, an extension of OpenPLC compatible with the IEC 61850 MMS protocol

License: GNU General Public License v3.0

Dockerfile 0.01% Shell 2.19% CMake 0.30% Batchfile 0.01% C++ 60.96% C 21.81% Makefile 0.34% Perl 0.20% M4 0.10% TeX 0.01% XSLT 0.42% HTML 3.85% C# 4.30% Scala 0.96% Java 3.03% Python 1.47% PowerShell 0.02% Lua 0.01% Ruby 0.01% SWIG 0.01%

openplc61850's People

Contributors

benn8 avatar wenshei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

openplc61850's Issues

OpenPLC not starting

Hello,
I'm tring to get OpenPLC61850 working. I've tried two approaches: with and without docker. Same result OpenPLC doesn't go in "running mode".

I tried compiling for the hardware again, it compiled succesfully:

Generating C files...
POUS.c
POUS.h
LOCATED_VARIABLES.h
VARIABLES.csv
Config0.c
Config0.h
Res0.c
Moving Files...
Compiling for Linux
Generating object files...
Generating glueVars...
Generating mapping file for IEC61850 client function

ST file: ../st_files/blank_program.st
SCL files: ../scl_client_files/ied01.icd ../scl_client_files/ied02.icd 
Outfile: iecclient.map

Parsing ST file
Parsing SCL file../scl_client_files/ied01.icd
Parsing SCL file../scl_client_files/ied02.icd
Mapping done, exit

Generating mapping file for IEC61850 server function

ST file: ../st_files/blank_program.st
SCL files: ../scl_server_files/scl.icd 
Outfile: iecserver.map

Parsing ST file
Parsing SCL file../scl_server_files/scl.icd
Mapping done, exit

Generating static_model...
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Select ICD File ../scl_server_files/scl.icd
parse data type templates ...
parse IED section ...
parse communication section ...
Found connectedAP W1 for IED TestServer
print report instance 01
print report instance 02
print report instance 03
print report instance 04
print report instance 05
print report instance 01
print report instance 02
print report instance 03
print report instance 04
print report instance 05
print report instance 01
print report instance 02
print report instance 03
print report instance 04
print report instance 05
print report instance 01
print report instance 02
print report instance 03
print report instance 04
print report instance 05
Compiling main program...
Compilation finished successfully! ```








The following is the error 



``` OpenPLC Runtime starting...
Skipping configuration of Slave Devices (mbconfig.cfg file not found)
Interactive Server: Listening on port 43628
Interactive Server: waiting for new client...
Warning: Persistent Storage file not found
Setting main thread priority to RT
WARNING: Failed to set main thread to real-time priority
Locking main thread memory
Getting current time
Enabling IEC61850 on port 102
Interactive Server: Client accepted! Creating thread for the new client ID: 7...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 7
Interactive Server: Client accepted! Creating thread for the new client ID: 8...
Interactive Server: client ID: 7 has closed the connection
Terminating interactive server connections
Interactive Server: waiting for new client...
Interactive Server: Client accepted! Creating thread for the new client ID: 7...
Interactive Server: Thread created for client ID: 8
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 7
Interactive Server: client ID: 8 has closed the connection
Terminating interactive server connections
Interactive Server: client ID: 7 has closed the connection
Terminating interactive server connections
127.0.0.1 - - [16/Nov/2023 13:48:50] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 7...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 7
Issued start_iec61850() command to start on port: 102
Interactive Server: client ID: 7 has closed the connection
Openning database
Terminating interactive server connections
Enabling Modbus on port 502
Starting IEC61850SERVER
Starting IEC61850CLIENT
Invalid mapping for IED01LogicalDevice/GGIO1.AnIn1.mag.f
Invalid mapping for IED01LogicalDevice/GGIO2.SPC1.Oper.ctlVal
Invalid mapping for IED02LogicalDevice/GGIO1.AnIn1.mag.f
Invalid mapping for IED02LogicalDevice/GGIO2.SPC1.Oper.ctlVal
mapping done
Setting control handler for TestServerLogicalDevice/GGIO2.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO3.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO5.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO6.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO8.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO9.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO11.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO12.SPCSO
Setting control handler for TestServerLogicalDevice/GGIO15.SPCSO1
Setting control handler for TestServerLogicalDevice/GGIO15.SPCSO2
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 3) > this->size() (which is 1)
OpenPLC Runtime is not running. Error: [Errno 104] Connection reset by peer
Enabling DNP3 on port 20000
Enabling EtherNet/IP on port 44818
Disabling Persistent Storage
persistent.file removed! ```





Has anyone else faced my same issue?
I've updated the Dockerfile since the one provided with the repository wasn't working:







``` ARG UBUNTU_VERSION=16.04
FROM ubuntu:$UBUNTU_VERSION
ARG PYTHON_VERSION=2.7.9
RUN apt-get update \
  && apt-get install -y sudo wget gcc make openssl libffi-dev libgdbm-dev libsqlite3-dev libssl-dev zlib1g-dev \
  && apt-get clean
WORKDIR /tmp/
RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz \
  && tar --extract -f Python-$PYTHON_VERSION.tgz \
  && cd ./Python-$PYTHON_VERSION/ \
  && ./configure --with-ensurepip=install --enable-optimizations --prefix=/usr/local \
  && make && make install \
  && cd ../ \
  && rm -r ./Python-$PYTHON_VERSION*
COPY . /workdir
RUN cd /workdir && ./install.sh docker
WORKDIR /workdir
CMD tail -f /dev/null ```

Incorrect error handling in `checkControlChanges`

Description

In webserver/core/iec61850client.cpp in the function checkControlChanges, the program attempts to check the current value of the IED to see if it needs to send a write command to the IED to update its values. However, when an error is encountered, it merely logs ErrorCheckingValueBeforeWriting and proceeds on with the rest of the code.

bool iedvalue = IedConnection_readBooleanValue(con, &error, stvalstr.c_str(), IEC61850_FC_ST);
if(error != IED_ERROR_OK) {
sprintf(log_msg_iecclient, "ErrorCheckingValueBeforeWriting for %s\n", stvalstr.c_str());
log(log_msg_iecclient);
}
if (iedvalue == newvalue) {
continue;
}
if (newvalue) {
sprintf(log_msg_iecclient, "Change in value detected (%s) = true\n", it.first.c_str());
sendOperateCommand(i, it.first, true);
}
else {
sprintf(log_msg_iecclient, "Change in value detected (%s) = false\n", it.first.c_str());
sendOperateCommand(i, it.first, false);
}

Possible fix

Ideally, the program should not continue with the rest of the code to send the write command to the IED as this will obscure the bug. There should probably be a continue statement in the conditional block.

Question

Hey,

is there any way to get in touch with you, to ask a few questions?
I'm actually trying to figure out the concept because i wanted to connect my OpenPLC61850 with another IED and i don't really understand how to.

Would be really glad if you'd message me,
regards
marco

The cid files I use results in an empty iecserver.map file

I'm having an issue getting my iecserver.map file to work

I'm wondering if there's a special format for the scl file to be used because I've tried many files and neither of them worked so far, they result in an empty server map file.
Do you have an example for a working scl file with stVal values that I could use to figure out where the issue is?
Generated server map file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.