GithubHelp home page GithubHelp logo

Comments (16)

m-unkel avatar m-unkel commented on September 25, 2024 1

However, the read command point.read() stopped working and is always returning False. In Wireshark, I noticed that the read command (C_RD_NA_1) was sent, and a valid response from my slave device was also sent, but the point.read() command still returns False.

A pushed a fix into the feature branch.

About this, the branch fix-test is up to date with main. Are there any commits left to push in your local repository?

Oh sorry, i pushed the missing commit.

from iec104-python.

FernandoMK avatar FernandoMK commented on September 25, 2024 1

Just letting you know, it seems that the automatic documentation from Sphinx has stopped working. The C++ Core section is okay, but the c104 Python module has no documentation on classes, methods, properties, and enums.

This is the C++ Core section:
iec104 c++ docs

This is the c104 python module section (everthing is like that):
iec104 python module docs

Is everything ok with the documentation?

from iec104-python.

m-unkel avatar m-unkel commented on September 25, 2024 1

release 1.17.1 is there

from iec104-python.

m-unkel avatar m-unkel commented on September 25, 2024

Thank you for the detailed report.

I can confirm that iec104-python is not sending commands with the select flag.
I will prepare a fix.

from iec104-python.

lennart-bader avatar lennart-bader commented on September 25, 2024

From my understanding, this should be an optional feature depending in the desired operation mode (direct vs. select and execute). Is this correct?

from iec104-python.

FernandoMK avatar FernandoMK commented on September 25, 2024

From my understanding, this should be an optional feature depending in the desired operation mode (direct vs. select and execute). Is this correct?

Hello Lennart Bader, thank you for the comment.

Based on my knowledge of the protocol, IEC60870-5-104, commands (whether Single or Double Commands) and set-points always have the field for Select/Execute. There is no such thing as "Directly."

from iec104-python.

lennart-bader avatar lennart-bader commented on September 25, 2024

For command transmission, IEC104 specifies two standard procedures according to this technical report (page 22):

  • "Direct command": Control operations are immediately executed (The "execute" flag is set for the first command, as currently implemented)
  • "Select and execute command": Two step command, where first the "select" flag is set, the operation is checked by remote station (but not yet executed) and then acknowledged (or not acknowledged) to the client. The client can then send the same command with the "execute" flag to actually instruct the remote station to execute the command

So just sending the "execute" flag is still according to standard, and I guess the "select & execute" mode is missing.

from iec104-python.

FernandoMK avatar FernandoMK commented on September 25, 2024

For command transmission, IEC104 specifies two standard procedures according to this technical report (page 22):

  • "Direct command": Control operations are immediately executed (The "execute" flag is set for the first command, as currently implemented)
  • "Select and execute command": Two step command, where first the "select" flag is set, the operation is checked by remote station (but not yet executed) and then acknowledged (or not acknowledged) to the client. The client can then send the same command with the "execute" flag to actually instruct the remote station to execute the command

So just sending the "execute" flag is still according to standard, and I guess the "select & execute" mode is missing.

You are correct. Based on this document and the IEC60870-5-101 standard (chapter 7.4.7), there is indeed a direct command mode that simply sends the execute flag. I apologize for my earlier misconception.

from iec104-python.

FernandoMK avatar FernandoMK commented on September 25, 2024

I'm working on a fix from a fork as well. I noticed that when running the test.py file located in "tests," the following exception occurs.

------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\...\iec104-python\tests\test.py", line 345, in <module>
    if sv_step_point.read():
ValueError: Cannot send read commands as server

Is the test suite broken, or is this an expected behavior?

from iec104-python.

m-unkel avatar m-unkel commented on September 25, 2024

There is a typo, yes, please see branch fix-test, I will merge it soon.

Here is a suggestion for the command mode feature:
#3

# new property: point.command_mode
# new enum: c104.CommandMode

single_command = station.add_point(io_address=16, type=c104.Type.C_SC_NA_1, command_mode=c104.CommandMode.SELECT_AND_EXECUTE)

from iec104-python.

m-unkel avatar m-unkel commented on September 25, 2024

Can you verify that this will fix the issue?
pip install git+https://github.com/Fraunhofer-FIT-DIEN/iec104-python.git@feature-command-mode

from iec104-python.

FernandoMK avatar FernandoMK commented on September 25, 2024

Can you verify that this will fix the issue? pip install git+https://github.com/Fraunhofer-FIT-DIEN/iec104-python.git@feature-command-mode

I tested this new version using the SELECT_EXECUTE flag. I tested it for the following commands: C_SC_NA_1, C_DC_NA_1, C_SE_NB_1, and C_SE_NC_1. All of them worked correctly.

However, the read command point.read() stopped working and is always returning False. In Wireshark, I noticed that the read command (C_RD_NA_1) was sent, and a valid response from my slave device was also sent, but the point.read() command still returns False.

Below is the Wireshark screenshot showing the C_RD_NA_1 command sent and the M_ME_NB_1 response being sent by the slave to the client.

wireshark - iec104 - python client - 2

There is a typo, yes, please see branch fix-test, I will merge it soon.

About this, the branch fix-test is up to date with main. Are there any commits left to push in your local repository?

from iec104-python.

FernandoMK avatar FernandoMK commented on September 25, 2024

It seems everything is fine now. I tested the write commands using the SELECT_EXECUTE flag and the read commands for M_SP_NA_1, M_DP_NA_1, M_ME_NB_1, and M_ME_NC_1. Everything I tested worked correctly.

I will be waiting for the merge and a formal release in PyPI. Thank you very much for your assistance.

from iec104-python.

coop-open-source avatar coop-open-source commented on September 25, 2024

The update was released to PyPI

from iec104-python.

FernandoMK avatar FernandoMK commented on September 25, 2024

I also noted that the C_SE_NA_1 commands were not fixed with the SELECT_AND_EXECUTE command mode. I opened a pull request with the correction. Just a simple fix :)

from iec104-python.

coop-open-source avatar coop-open-source commented on September 25, 2024

thanks I merged your contribution!
I will create a 1.17.1 once the documentation generation is fixed..

from iec104-python.

Related Issues (19)

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.